@vtex/api 6.48.1-beta.3 → 6.49.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 (192) hide show
  1. package/gen/manifest.schema +1 -1
  2. package/lib/HttpClient/GraphQLClient.d.ts +1 -1
  3. package/lib/HttpClient/HttpClient.d.ts +3 -2
  4. package/lib/HttpClient/HttpClient.js +14 -14
  5. package/lib/HttpClient/agents.d.ts +5 -2
  6. package/lib/HttpClient/agents.js +10 -4
  7. package/lib/HttpClient/index.js +7 -2
  8. package/lib/HttpClient/middlewares/cache.d.ts +1 -1
  9. package/lib/HttpClient/middlewares/cache.js +43 -44
  10. package/lib/HttpClient/middlewares/cancellationToken.d.ts +1 -1
  11. package/lib/HttpClient/middlewares/cancellationToken.js +2 -1
  12. package/lib/HttpClient/middlewares/inflight.d.ts +1 -1
  13. package/lib/HttpClient/middlewares/inflight.js +6 -3
  14. package/lib/HttpClient/middlewares/memoization.d.ts +1 -1
  15. package/lib/HttpClient/middlewares/memoization.js +9 -8
  16. package/lib/HttpClient/middlewares/metrics.js +8 -11
  17. package/lib/HttpClient/middlewares/notFound.d.ts +1 -1
  18. package/lib/HttpClient/middlewares/notFound.js +4 -2
  19. package/lib/HttpClient/middlewares/recorder.js +2 -5
  20. package/lib/HttpClient/middlewares/request/HttpAgentSingleton.js +1 -1
  21. package/lib/HttpClient/middlewares/request/index.d.ts +1 -1
  22. package/lib/HttpClient/middlewares/request/index.js +13 -10
  23. package/lib/HttpClient/middlewares/request/setupAxios/index.d.ts +0 -1
  24. package/lib/HttpClient/middlewares/request/setupAxios/index.js +5 -4
  25. package/lib/HttpClient/middlewares/request/setupAxios/interceptors/exponentialBackoff.js +6 -5
  26. package/lib/HttpClient/middlewares/request/setupAxios/interceptors/index.js +1 -0
  27. package/lib/HttpClient/middlewares/request/setupAxios/interceptors/tracing/index.js +8 -8
  28. package/lib/HttpClient/middlewares/request/setupAxios/interceptors/tracing/spanSetup.js +10 -8
  29. package/lib/HttpClient/middlewares/tracing.js +11 -14
  30. package/lib/HttpClient/typings.d.ts +3 -3
  31. package/lib/caches/DiskCache.js +3 -3
  32. package/lib/caches/LRUCache.d.ts +2 -2
  33. package/lib/caches/LRUDiskCache.d.ts +1 -1
  34. package/lib/caches/LRUDiskCache.js +3 -3
  35. package/lib/caches/MultilayeredCache.d.ts +2 -2
  36. package/lib/caches/MultilayeredCache.js +7 -7
  37. package/lib/caches/index.js +6 -2
  38. package/lib/caches/typings.d.ts +5 -5
  39. package/lib/clients/IOClient.d.ts +1 -1
  40. package/lib/clients/IOClients.d.ts +1 -1
  41. package/lib/clients/apps/AppClient.js +1 -1
  42. package/lib/clients/apps/AppGraphQLClient.js +1 -1
  43. package/lib/clients/apps/Billing.d.ts +1 -1
  44. package/lib/clients/apps/Builder.d.ts +7 -7
  45. package/lib/clients/apps/Builder.js +1 -1
  46. package/lib/clients/apps/MessagesGraphQL.d.ts +1 -1
  47. package/lib/clients/apps/MessagesGraphQL.js +3 -3
  48. package/lib/clients/apps/Settings.js +3 -3
  49. package/lib/clients/apps/catalogGraphQL/index.d.ts +4 -4
  50. package/lib/clients/apps/catalogGraphQL/index.js +4 -4
  51. package/lib/clients/apps/index.js +6 -2
  52. package/lib/clients/external/ID.d.ts +4 -4
  53. package/lib/clients/external/PaymentProvider.d.ts +2 -2
  54. package/lib/clients/external/index.js +6 -2
  55. package/lib/clients/index.js +6 -2
  56. package/lib/clients/infra/Apps.d.ts +32 -27
  57. package/lib/clients/infra/Apps.js +16 -18
  58. package/lib/clients/infra/Assets.d.ts +6 -5
  59. package/lib/clients/infra/Assets.js +11 -11
  60. package/lib/clients/infra/BillingMetrics.d.ts +1 -1
  61. package/lib/clients/infra/Events.d.ts +1 -1
  62. package/lib/clients/infra/Events.js +1 -1
  63. package/lib/clients/infra/Housekeeper.d.ts +3 -3
  64. package/lib/clients/infra/Registry.d.ts +23 -17
  65. package/lib/clients/infra/Registry.js +3 -4
  66. package/lib/clients/infra/Router.d.ts +8 -8
  67. package/lib/clients/infra/Sphinx.d.ts +2 -2
  68. package/lib/clients/infra/VBase.d.ts +15 -14
  69. package/lib/clients/infra/VBase.js +3 -3
  70. package/lib/clients/infra/Workspaces.d.ts +7 -7
  71. package/lib/clients/infra/index.js +6 -2
  72. package/lib/clients/janus/JanusClient.d.ts +1 -1
  73. package/lib/clients/janus/LicenseManager.js +1 -1
  74. package/lib/clients/janus/Segment.d.ts +3 -3
  75. package/lib/clients/janus/Segment.js +2 -2
  76. package/lib/clients/janus/Session.d.ts +2 -2
  77. package/lib/clients/janus/Tenant.d.ts +1 -1
  78. package/lib/clients/janus/index.js +6 -2
  79. package/lib/constants.d.ts +2 -1
  80. package/lib/constants.js +3 -2
  81. package/lib/errors/ResolverError.js +1 -1
  82. package/lib/errors/index.js +6 -2
  83. package/lib/index.js +6 -2
  84. package/lib/metrics/MetricsAccumulator.d.ts +2 -2
  85. package/lib/metrics/MetricsAccumulator.js +9 -9
  86. package/lib/responses.d.ts +4 -4
  87. package/lib/service/index.js +7 -9
  88. package/lib/service/loaders.js +8 -6
  89. package/lib/service/logger/client.d.ts +2 -0
  90. package/lib/service/logger/client.js +48 -0
  91. package/lib/service/logger/console.d.ts +1 -1
  92. package/lib/service/logger/console.js +7 -4
  93. package/lib/service/logger/index.d.ts +2 -0
  94. package/lib/service/logger/index.js +8 -2
  95. package/lib/service/logger/logger.d.ts +4 -15
  96. package/lib/service/logger/logger.js +61 -18
  97. package/lib/service/logger/loggerTypes.d.ts +14 -0
  98. package/lib/service/logger/loggerTypes.js +10 -0
  99. package/lib/service/logger/metricsLogger.js +10 -10
  100. package/lib/service/master.js +7 -6
  101. package/lib/service/metrics/requestMetricsMiddleware.js +14 -13
  102. package/lib/service/telemetry/client.d.ts +3 -0
  103. package/lib/service/telemetry/client.js +57 -0
  104. package/lib/service/telemetry/index.d.ts +1 -0
  105. package/lib/service/telemetry/index.js +17 -0
  106. package/lib/service/tracing/TracerSingleton.js +9 -9
  107. package/lib/service/tracing/metrics/MetricNames.js +12 -12
  108. package/lib/service/tracing/metrics/instruments.js +14 -7
  109. package/lib/service/tracing/metrics/measurers/EventLoopLagMeasurer.js +5 -5
  110. package/lib/service/tracing/tracingMiddlewares.js +18 -21
  111. package/lib/service/worker/index.js +25 -24
  112. package/lib/service/worker/listeners.js +2 -1
  113. package/lib/service/worker/runtime/Service.js +1 -1
  114. package/lib/service/worker/runtime/builtIn/handlers.js +6 -3
  115. package/lib/service/worker/runtime/builtIn/middlewares.js +5 -3
  116. package/lib/service/worker/runtime/events/index.d.ts +1 -1
  117. package/lib/service/worker/runtime/events/index.js +11 -10
  118. package/lib/service/worker/runtime/events/middlewares/body.js +3 -6
  119. package/lib/service/worker/runtime/events/middlewares/context.js +1 -1
  120. package/lib/service/worker/runtime/events/router.js +3 -2
  121. package/lib/service/worker/runtime/graphql/index.js +8 -7
  122. package/lib/service/worker/runtime/graphql/middlewares/error.js +5 -8
  123. package/lib/service/worker/runtime/graphql/middlewares/query.js +7 -6
  124. package/lib/service/worker/runtime/graphql/middlewares/response.js +1 -1
  125. package/lib/service/worker/runtime/graphql/middlewares/run.js +3 -2
  126. package/lib/service/worker/runtime/graphql/middlewares/updateSchema.js +4 -3
  127. package/lib/service/worker/runtime/graphql/middlewares/upload.js +1 -1
  128. package/lib/service/worker/runtime/graphql/schema/index.d.ts +1 -1
  129. package/lib/service/worker/runtime/graphql/schema/index.js +8 -7
  130. package/lib/service/worker/runtime/graphql/schema/messagesLoaderV2.d.ts +2 -2
  131. package/lib/service/worker/runtime/graphql/schema/messagesLoaderV2.js +4 -3
  132. package/lib/service/worker/runtime/graphql/schema/schemaDirectives/Auth.js +1 -1
  133. package/lib/service/worker/runtime/graphql/schema/schemaDirectives/Deprecated.js +1 -1
  134. package/lib/service/worker/runtime/graphql/schema/schemaDirectives/Settings.js +1 -1
  135. package/lib/service/worker/runtime/graphql/schema/schemaDirectives/TranslatableV2.js +2 -2
  136. package/lib/service/worker/runtime/graphql/schema/schemaDirectives/TranslateTo.js +2 -2
  137. package/lib/service/worker/runtime/graphql/schema/schemaDirectives/index.js +1 -1
  138. package/lib/service/worker/runtime/graphql/schema/typeDefs/index.js +2 -1
  139. package/lib/service/worker/runtime/graphql/schema/typeDefs/sanitizedString.js +2 -2
  140. package/lib/service/worker/runtime/graphql/typings.d.ts +3 -3
  141. package/lib/service/worker/runtime/graphql/utils/cacheControl.js +2 -1
  142. package/lib/service/worker/runtime/graphql/utils/error.js +10 -9
  143. package/lib/service/worker/runtime/graphql/utils/pathname.js +3 -2
  144. package/lib/service/worker/runtime/graphql/utils/translations.d.ts +1 -1
  145. package/lib/service/worker/runtime/graphql/utils/translations.js +7 -4
  146. package/lib/service/worker/runtime/http/index.d.ts +2 -2
  147. package/lib/service/worker/runtime/http/index.js +22 -20
  148. package/lib/service/worker/runtime/http/middlewares/context.js +7 -5
  149. package/lib/service/worker/runtime/http/middlewares/error.js +6 -9
  150. package/lib/service/worker/runtime/http/middlewares/rateLimit.js +1 -1
  151. package/lib/service/worker/runtime/http/middlewares/setCookie.js +5 -5
  152. package/lib/service/worker/runtime/http/middlewares/settings.d.ts +1 -1
  153. package/lib/service/worker/runtime/http/middlewares/settings.js +13 -9
  154. package/lib/service/worker/runtime/http/middlewares/timings.js +3 -3
  155. package/lib/service/worker/runtime/http/router.js +3 -2
  156. package/lib/service/worker/runtime/http/routes.js +8 -5
  157. package/lib/service/worker/runtime/method.d.ts +2 -2
  158. package/lib/service/worker/runtime/method.js +1 -1
  159. package/lib/service/worker/runtime/statusTrack.d.ts +1 -1
  160. package/lib/service/worker/runtime/statusTrack.js +10 -5
  161. package/lib/service/worker/runtime/typings.d.ts +10 -10
  162. package/lib/service/worker/runtime/utils/compose.d.ts +2 -2
  163. package/lib/service/worker/runtime/utils/compose.js +4 -2
  164. package/lib/service/worker/runtime/utils/context.d.ts +2 -2
  165. package/lib/service/worker/runtime/utils/context.js +5 -4
  166. package/lib/service/worker/runtime/utils/recorder.js +1 -1
  167. package/lib/service/worker/runtime/utils/toArray.js +2 -1
  168. package/lib/tracing/UserLandTracer.js +3 -2
  169. package/lib/tracing/errorReporting/ErrorReport.js +13 -13
  170. package/lib/tracing/index.js +1 -1
  171. package/lib/tracing/utils.js +5 -4
  172. package/lib/utils/MineWinsConflictsResolver.d.ts +4 -4
  173. package/lib/utils/MineWinsConflictsResolver.js +10 -10
  174. package/lib/utils/app.js +39 -23
  175. package/lib/utils/appsStaleIfError.d.ts +1 -0
  176. package/lib/utils/appsStaleIfError.js +17 -9
  177. package/lib/utils/billingOptions.js +2 -1
  178. package/lib/utils/binding.js +4 -2
  179. package/lib/utils/domain.js +1 -1
  180. package/lib/utils/error.js +5 -4
  181. package/lib/utils/index.js +6 -2
  182. package/lib/utils/log.js +3 -2
  183. package/lib/utils/message.js +8 -5
  184. package/lib/utils/renameBy.js +2 -1
  185. package/lib/utils/retry.js +8 -6
  186. package/lib/utils/status.js +2 -1
  187. package/lib/utils/tenant.js +4 -2
  188. package/lib/utils/time.d.ts +1 -1
  189. package/lib/utils/time.js +23 -14
  190. package/package.json +27 -5
  191. package/lib/utils/buildFullPath.d.ts +0 -11
  192. package/lib/utils/buildFullPath.js +0 -54
@@ -7,16 +7,16 @@ const settings_1 = require("../../service/worker/runtime/http/middlewares/settin
7
7
  const app_1 = require("../../utils/app");
8
8
  const AppClient_1 = require("./AppClient");
9
9
  const LINKED_ROUTE = 'linked';
10
- const containsLinks = ramda_1.any(app_1.isLinkedApp);
10
+ const containsLinks = (0, ramda_1.any)(app_1.isLinkedApp);
11
11
  class Settings extends AppClient_1.AppClient {
12
12
  constructor(context, options) {
13
13
  super('vtex.settings-server@0.x', context, options);
14
14
  }
15
15
  getFilteredDependencies(appAtMajor, dependencies) {
16
- return settings_1.getFilteredDependencies(appAtMajor, dependencies);
16
+ return (0, settings_1.getFilteredDependencies)(appAtMajor, dependencies);
17
17
  }
18
18
  getDependenciesHash(dependencies) {
19
- return settings_1.getDependenciesHash(dependencies);
19
+ return (0, settings_1.getDependenciesHash)(dependencies);
20
20
  }
21
21
  async getSettings(dependencies, appAtMajor, params, tracingConfig) {
22
22
  const filtered = this.getFilteredDependencies(appAtMajor, dependencies);
@@ -7,16 +7,16 @@ import { Product } from './product';
7
7
  import { SKU } from './sku';
8
8
  export declare class CatalogGraphQL extends AppGraphQLClient {
9
9
  constructor(ctx: IOContext, opts?: InstanceOptions);
10
- sku: (id: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<{
10
+ sku: (id: string, tracingConfig?: RequestTracingConfig) => Promise<{
11
11
  sku: SKU;
12
12
  } | undefined>;
13
- product: (id: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<{
13
+ product: (id: string, tracingConfig?: RequestTracingConfig) => Promise<{
14
14
  product: Product;
15
15
  } | undefined>;
16
- category: (id: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<{
16
+ category: (id: string, tracingConfig?: RequestTracingConfig) => Promise<{
17
17
  category: Category;
18
18
  } | undefined>;
19
- brand: (id: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<{
19
+ brand: (id: string, tracingConfig?: RequestTracingConfig) => Promise<{
20
20
  brand: Brand;
21
21
  } | undefined>;
22
22
  }
@@ -35,7 +35,7 @@ class CatalogGraphQL extends __1.AppGraphQLClient {
35
35
  ...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
36
36
  },
37
37
  })
38
- .then(ramda_1.prop('data'));
38
+ .then((0, ramda_1.prop)('data'));
39
39
  };
40
40
  this.product = (id, tracingConfig) => {
41
41
  const variables = {
@@ -56,7 +56,7 @@ class CatalogGraphQL extends __1.AppGraphQLClient {
56
56
  ...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
57
57
  },
58
58
  })
59
- .then(ramda_1.prop('data'));
59
+ .then((0, ramda_1.prop)('data'));
60
60
  };
61
61
  this.category = (id, tracingConfig) => this.graphql
62
62
  .query({
@@ -70,7 +70,7 @@ class CatalogGraphQL extends __1.AppGraphQLClient {
70
70
  ...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
71
71
  },
72
72
  })
73
- .then(ramda_1.prop('data'));
73
+ .then((0, ramda_1.prop)('data'));
74
74
  this.brand = (id, tracingConfig) => this.graphql
75
75
  .query({
76
76
  inflight: true,
@@ -83,7 +83,7 @@ class CatalogGraphQL extends __1.AppGraphQLClient {
83
83
  ...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
84
84
  },
85
85
  })
86
- .then(ramda_1.prop('data'));
86
+ .then((0, ramda_1.prop)('data'));
87
87
  }
88
88
  }
89
89
  exports.CatalogGraphQL = CatalogGraphQL;
@@ -1,13 +1,17 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
15
  };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  __exportStar(require("./AppClient"), exports);
@@ -3,10 +3,10 @@ import { IOContext } from '../../service/worker/runtime/typings';
3
3
  import { ExternalClient } from './ExternalClient';
4
4
  export declare class ID extends ExternalClient {
5
5
  constructor(context: IOContext, opts?: InstanceOptions);
6
- getTemporaryToken: (tracingConfig?: RequestTracingConfig | undefined) => Promise<string>;
7
- sendCodeToEmail: (token: string, email: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<any>;
8
- getEmailCodeAuthenticationToken: (token: string, email: string, code: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<AuthenticationResponse>;
9
- getPasswordAuthenticationToken: (token: string, email: string, password: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<AuthenticationResponse>;
6
+ getTemporaryToken: (tracingConfig?: RequestTracingConfig) => Promise<string>;
7
+ sendCodeToEmail: (token: string, email: string, tracingConfig?: RequestTracingConfig) => Promise<any>;
8
+ getEmailCodeAuthenticationToken: (token: string, email: string, code: string, tracingConfig?: RequestTracingConfig) => Promise<AuthenticationResponse>;
9
+ getPasswordAuthenticationToken: (token: string, email: string, password: string, tracingConfig?: RequestTracingConfig) => Promise<AuthenticationResponse>;
10
10
  }
11
11
  export interface AuthenticationResponse {
12
12
  promptMFA: boolean;
@@ -4,8 +4,8 @@ import { ExternalClient } from './ExternalClient';
4
4
  export declare class PaymentProvider extends ExternalClient {
5
5
  protected context: IOContext;
6
6
  constructor(context: IOContext, options?: InstanceOptions);
7
- callback: (transactionId: string, paymentId: string, callback: AuthorizationCallback, tracingConfig?: RequestTracingConfig | undefined) => Promise<unknown>;
8
- inbound: <TRequest, TResponse>(transactionId: string, paymentId: string, action: string, payload: TRequest, tracingConfig?: RequestTracingConfig | undefined) => Promise<TResponse>;
7
+ callback: (transactionId: string, paymentId: string, callback: AuthorizationCallback, tracingConfig?: RequestTracingConfig) => Promise<unknown>;
8
+ inbound: <TRequest, TResponse>(transactionId: string, paymentId: string, action: string, payload: TRequest, tracingConfig?: RequestTracingConfig) => Promise<TResponse>;
9
9
  }
10
10
  export interface AuthorizationCallback {
11
11
  paymentId: string;
@@ -1,13 +1,17 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
15
  };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  __exportStar(require("./ExternalClient"), exports);
@@ -1,13 +1,17 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
15
  };
12
16
  var __importDefault = (this && this.__importDefault) || function (mod) {
13
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -1,9 +1,12 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ /// <reference types="node" />
2
5
  import { IncomingMessage } from 'http';
3
6
  import { Readable, Writable } from 'stream';
4
7
  import { ZlibOptions } from 'zlib';
5
8
  import { InstanceOptions, RequestTracingConfig } from '../../HttpClient';
6
- import { AppBundleLinked, AppFilesList, AppManifest } from '../../responses';
9
+ import { AppFilesList, AppManifest } from '../../responses';
7
10
  import { IOContext } from '../../service/worker/runtime/typings';
8
11
  import { InfraClient } from './InfraClient';
9
12
  export declare class Apps extends InfraClient {
@@ -12,35 +15,37 @@ export declare class Apps extends InfraClient {
12
15
  private memoryCache;
13
16
  private get routes();
14
17
  constructor(context: IOContext, options?: InstanceOptions);
15
- installApp: (descriptor: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<void> | Promise<AppInstallResponse>;
16
- uninstallApp: (app: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<import("../..").IOResponse<void>>;
17
- acknowledgeApp: (app: string, service: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<void>;
18
- link: (app: string, files: Change[], { zlib }?: ZipOptions, tracingConfig?: RequestTracingConfig | undefined) => Promise<AppBundleLinked>;
19
- patch: (app: string, changes: Change[], { zlib }?: ZipOptions, tracingConfig?: RequestTracingConfig | undefined) => Promise<void>;
20
- unlink: (app: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<import("../..").IOResponse<void>>;
21
- unlinkAll: (tracingConfig?: RequestTracingConfig | undefined) => Promise<import("../..").IOResponse<void>>;
22
- saveAppSettings: (app: string, settings: any, tracingConfig?: RequestTracingConfig | undefined) => Promise<void>;
23
- listApps: ({ oldVersion, since, service }?: ListAppsOptions, tracingConfig?: RequestTracingConfig | undefined) => Promise<AppsList>;
24
- listAppFiles: (app: string, { prefix, nextMarker }?: ListFilesOptions, tracingConfig?: RequestTracingConfig | undefined) => Promise<AppFilesList>;
25
- listLinks: (tracingConfig?: RequestTracingConfig | undefined) => Promise<string[]>;
26
- getAppFile: (app: string, path: string, staleIfError?: boolean | undefined, tracingConfig?: RequestTracingConfig | undefined) => Promise<{
18
+ installApp: (descriptor: string, tracingConfig?: RequestTracingConfig) => Promise<void> | Promise<AppInstallResponse>;
19
+ uninstallApp: (app: string, tracingConfig?: RequestTracingConfig) => Promise<import("../..").IOResponse<void>>;
20
+ acknowledgeApp: (app: string, service: string, tracingConfig?: RequestTracingConfig) => Promise<void>;
21
+ link: (app: string, files: Change[], { zlib }?: ZipOptions, tracingConfig?: RequestTracingConfig) => Promise<import("../..").AppBundleResponse & {
22
+ bundleSize?: number | undefined;
23
+ }>;
24
+ patch: (app: string, changes: Change[], { zlib }?: ZipOptions, tracingConfig?: RequestTracingConfig) => Promise<void>;
25
+ unlink: (app: string, tracingConfig?: RequestTracingConfig) => Promise<import("../..").IOResponse<void>>;
26
+ unlinkAll: (tracingConfig?: RequestTracingConfig) => Promise<import("../..").IOResponse<void>>;
27
+ saveAppSettings: (app: string, settings: any, tracingConfig?: RequestTracingConfig) => Promise<void>;
28
+ listApps: ({ oldVersion, since, service }?: ListAppsOptions, tracingConfig?: RequestTracingConfig) => Promise<AppsList>;
29
+ listAppFiles: (app: string, { prefix, nextMarker }?: ListFilesOptions, tracingConfig?: RequestTracingConfig) => Promise<AppFilesList>;
30
+ listLinks: (tracingConfig?: RequestTracingConfig) => Promise<string[]>;
31
+ getAppFile: (app: string, path: string, staleIfError?: boolean, tracingConfig?: RequestTracingConfig) => Promise<{
27
32
  data: Buffer;
28
33
  headers: any;
29
34
  }>;
30
- getAppJSON: <T extends object | null>(app: string, path: string, nullIfNotFound?: boolean | undefined, tracingConfig?: RequestTracingConfig | undefined) => Promise<T>;
31
- getFileFromApps: <T extends object | null>(app: string, path: string, nullIfNotFound?: boolean | undefined, tracingConfig?: RequestTracingConfig | undefined) => Promise<T>;
32
- getAppFileStream: (app: string, path: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<IncomingMessage>;
33
- getApp: (app: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<AppManifest>;
34
- getAppSettings: (app: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<any>;
35
- getAllAppsSettings: (listAppsOptions?: ListAppsOptions, tracingConfig?: RequestTracingConfig | undefined) => Promise<AppsSettings>;
36
- getAppBundle: (app: string, bundlePath: string, generatePackageJson: boolean, tracingConfig?: RequestTracingConfig | undefined) => Promise<Readable>;
37
- unpackAppBundle: (app: string, bundlePath: string, unpackPath: string, generatePackageJson: boolean, tracingConfig?: RequestTracingConfig | undefined) => Promise<Writable>;
38
- getAppsMetaInfos: (filter?: string | undefined, staleWhileRevalidate?: boolean, tracingConfig?: RequestTracingConfig | undefined) => Promise<AppMetaInfo[]>;
39
- getDependencies: (filter?: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<Record<string, string[]>>;
40
- updateDependencies: (tracingConfig?: RequestTracingConfig | undefined) => Promise<Record<string, string[]>>;
41
- updateDependency: (name: string, version: string, registry: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<void>;
42
- resolveDependencies: (apps: string[], registries: string[], filter?: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<any>;
43
- resolveDependenciesWithManifest: (manifest: AppManifest, filter?: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<Record<string, string[]>>;
35
+ getAppJSON: <T extends object | null>(app: string, path: string, nullIfNotFound?: boolean, tracingConfig?: RequestTracingConfig) => Promise<T>;
36
+ getFileFromApps: <T extends object | null>(app: string, path: string, nullIfNotFound?: boolean, tracingConfig?: RequestTracingConfig) => Promise<T>;
37
+ getAppFileStream: (app: string, path: string, tracingConfig?: RequestTracingConfig) => Promise<IncomingMessage>;
38
+ getApp: (app: string, tracingConfig?: RequestTracingConfig) => Promise<AppManifest>;
39
+ getAppSettings: (app: string, tracingConfig?: RequestTracingConfig) => Promise<any>;
40
+ getAllAppsSettings: (listAppsOptions?: ListAppsOptions, tracingConfig?: RequestTracingConfig) => Promise<AppsSettings>;
41
+ getAppBundle: (app: string, bundlePath: string, generatePackageJson: boolean, tracingConfig?: RequestTracingConfig) => Promise<Readable>;
42
+ unpackAppBundle: (app: string, bundlePath: string, unpackPath: string, generatePackageJson: boolean, tracingConfig?: RequestTracingConfig) => Promise<Writable>;
43
+ getAppsMetaInfos: (filter?: string, staleWhileRevalidate?: boolean, tracingConfig?: RequestTracingConfig) => Promise<AppMetaInfo[]>;
44
+ getDependencies: (filter?: string, tracingConfig?: RequestTracingConfig) => Promise<Record<string, string[]>>;
45
+ updateDependencies: (tracingConfig?: RequestTracingConfig) => Promise<Record<string, string[]>>;
46
+ updateDependency: (name: string, version: string, registry: string, tracingConfig?: RequestTracingConfig) => Promise<void>;
47
+ resolveDependencies: (apps: string[], registries: string[], filter?: string, tracingConfig?: RequestTracingConfig) => Promise<any>;
48
+ resolveDependenciesWithManifest: (manifest: AppManifest, filter?: string, tracingConfig?: RequestTracingConfig) => Promise<Record<string, string[]>>;
44
49
  private installRuntime;
45
50
  }
46
51
  interface ZipOptions {
@@ -37,7 +37,7 @@ const createRoutes = ({ account, workspace }) => {
37
37
  };
38
38
  return routes;
39
39
  };
40
- const getVendorAndName = ({ id }) => utils_1.removeVersionFromAppId(id);
40
+ const getVendorAndName = ({ id }) => (0, utils_1.removeVersionFromAppId)(id);
41
41
  const notFound = (e) => {
42
42
  if (e.response && e.response.status === 404) {
43
43
  return {};
@@ -71,6 +71,9 @@ const workspaceFields = [
71
71
  'version',
72
72
  ].join(',');
73
73
  class Apps extends InfraClient_1.InfraClient {
74
+ get routes() {
75
+ return this._routes;
76
+ }
74
77
  constructor(context, options) {
75
78
  super('apps@0.x', context, options, true);
76
79
  this.installApp = (descriptor, tracingConfig) => {
@@ -118,7 +121,7 @@ class Apps extends InfraClient_1.InfraClient {
118
121
  if (indexOfManifest === -1) {
119
122
  throw new Error('No manifest.json file found in files.');
120
123
  }
121
- const zip = archiver_1.default('zip', { zlib });
124
+ const zip = (0, archiver_1.default)('zip', { zlib });
122
125
  // Throw stream errors so they reject the promise chain.
123
126
  zip.on('error', (e) => {
124
127
  throw e;
@@ -140,8 +143,6 @@ class Apps extends InfraClient_1.InfraClient {
140
143
  return response;
141
144
  }
142
145
  catch (e) {
143
- // Typing cast for compatibility with error handling in TS versions > 4.0
144
- // Source: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#unknown-on-catch-clause-bindings
145
146
  e.bundleSize = zip.pointer();
146
147
  throw e;
147
148
  }
@@ -155,7 +156,7 @@ class Apps extends InfraClient_1.InfraClient {
155
156
  .filter(change => !change.content)
156
157
  .map(change => change.path)
157
158
  .join(':');
158
- const zip = archiver_1.default('zip', { zlib });
159
+ const zip = (0, archiver_1.default)('zip', { zlib });
159
160
  // Throw stream errors so they reject the promise chain.
160
161
  zip.on('error', (e) => {
161
162
  throw e;
@@ -222,7 +223,7 @@ class Apps extends InfraClient_1.InfraClient {
222
223
  });
223
224
  };
224
225
  this.listAppFiles = (app, { prefix, nextMarker } = {}, tracingConfig) => {
225
- const locator = utils_1.parseAppId(app);
226
+ const locator = (0, utils_1.parseAppId)(app);
226
227
  const linked = !!locator.build;
227
228
  const params = {
228
229
  marker: nextMarker,
@@ -254,11 +255,11 @@ class Apps extends InfraClient_1.InfraClient {
254
255
  };
255
256
  this.getAppFile = (app, path, staleIfError, tracingConfig) => {
256
257
  const { logger } = this.context;
257
- const locator = utils_1.parseAppId(app);
258
+ const locator = (0, utils_1.parseAppId)(app);
258
259
  const linked = !!locator.build;
259
260
  const inflightKey = HttpClient_1.inflightURL;
260
261
  if (staleIfError && this.memoryCache) {
261
- appsStaleIfError_1.saveVersion(app, this.memoryCache);
262
+ (0, appsStaleIfError_1.saveVersion)(app, this.memoryCache);
262
263
  }
263
264
  const metric = linked ? 'apps-get-file' : 'registry-get-file';
264
265
  try {
@@ -275,13 +276,13 @@ class Apps extends InfraClient_1.InfraClient {
275
276
  catch (error) {
276
277
  logger.error({ error, message: 'getAppFile failed', app, path });
277
278
  if (staleIfError && this.memoryCache) {
278
- return appsStaleIfError_1.getFallbackFile(app, path, this.memoryCache, this);
279
+ return (0, appsStaleIfError_1.getFallbackFile)(app, path, this.memoryCache, this);
279
280
  }
280
281
  throw error;
281
282
  }
282
283
  };
283
284
  this.getAppJSON = (app, path, nullIfNotFound, tracingConfig) => {
284
- const locator = utils_1.parseAppId(app);
285
+ const locator = (0, utils_1.parseAppId)(app);
285
286
  const linked = !!locator.build;
286
287
  const inflightKey = HttpClient_1.inflightURL;
287
288
  const metric = linked ? 'apps-get-json' : 'registry-get-json';
@@ -311,7 +312,7 @@ class Apps extends InfraClient_1.InfraClient {
311
312
  });
312
313
  };
313
314
  this.getAppFileStream = (app, path, tracingConfig) => {
314
- const locator = utils_1.parseAppId(app);
315
+ const locator = (0, utils_1.parseAppId)(app);
315
316
  const metric = locator.build ? 'apps-get-file-s' : 'registry-get-file-s';
316
317
  return this.http.getStream(this.routes.File(locator, path), {
317
318
  metric,
@@ -355,7 +356,7 @@ class Apps extends InfraClient_1.InfraClient {
355
356
  });
356
357
  };
357
358
  this.getAppBundle = (app, bundlePath, generatePackageJson, tracingConfig) => {
358
- const locator = utils_1.parseAppId(app);
359
+ const locator = (0, utils_1.parseAppId)(app);
359
360
  const params = generatePackageJson && { _packageJSONEngine: 'npm', _packageJSONFilter: 'vtex.render-builder@x' };
360
361
  const metric = locator.build ? 'apps-get-bundle' : 'registry-get-bundle';
361
362
  return this.http.getStream(this.routes.AppBundle(locator, bundlePath), {
@@ -374,15 +375,15 @@ class Apps extends InfraClient_1.InfraClient {
374
375
  this.unpackAppBundle = (app, bundlePath, unpackPath, generatePackageJson, tracingConfig) => {
375
376
  return this.getAppBundle(app, bundlePath, generatePackageJson, tracingConfig)
376
377
  .then(stream => stream
377
- .pipe(zlib_1.createGunzip())
378
- .pipe(tar_fs_1.extract(unpackPath)));
378
+ .pipe((0, zlib_1.createGunzip)())
379
+ .pipe((0, tar_fs_1.extract)(unpackPath)));
379
380
  };
380
381
  this.getAppsMetaInfos = async (filter, staleWhileRevalidate = true, tracingConfig) => {
381
382
  var _a;
382
383
  const { account, production, recorder, workspace, logger } = this.context;
383
384
  const metric = 'get-apps-meta';
384
385
  const inflightKey = HttpClient_1.inflightURL;
385
- const key = appsStaleIfError_1.getMetaInfoKey(account, workspace);
386
+ const key = (0, appsStaleIfError_1.getMetaInfoKey)(account, workspace);
386
387
  const cachedResponse = production && staleWhileRevalidate
387
388
  ? await ((_a = this.diskCache) === null || _a === void 0 ? void 0 : _a.get(key))
388
389
  : undefined;
@@ -504,8 +505,5 @@ class Apps extends InfraClient_1.InfraClient {
504
505
  this.memoryCache = options && options.memoryCache;
505
506
  this._routes = createRoutes(context);
506
507
  }
507
- get routes() {
508
- return this._routes;
509
- }
510
508
  }
511
509
  exports.Apps = Apps;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { Readable } from 'stream';
3
4
  import { AppMetaInfo } from '../..';
4
5
  import { InstanceOptions, RequestTracingConfig } from '../../HttpClient';
@@ -20,14 +21,14 @@ export declare class Assets extends InfraClient {
20
21
  headers: any;
21
22
  }>;
22
23
  getFilteredDependencies(apps: string | string[], dependencies: AppMetaInfo[]): AppMetaInfo[];
23
- getAppBundleByVendor: (app: string, bundlePath: string, generatePackageJson: boolean, tracingConfig?: RequestTracingConfig | undefined) => Promise<Readable>;
24
- protected getAppJSONByAccount: <T extends object | null>(app: string, path: string, nullIfNotFound?: boolean | undefined, tracingConfig?: RequestTracingConfig | undefined) => Promise<T>;
25
- protected getAppJSONByVendor: <T extends object | null>(app: string, path: string, nullIfNotFound?: boolean | undefined, tracingConfig?: RequestTracingConfig | undefined) => Promise<T>;
26
- protected getAppFileByAccount: (app: string, path: string, nullIfNotFound?: boolean | undefined, tracingConfig?: RequestTracingConfig | undefined) => Promise<{
24
+ getAppBundleByVendor: (app: string, bundlePath: string, generatePackageJson: boolean, tracingConfig?: RequestTracingConfig) => Promise<Readable>;
25
+ protected getAppJSONByAccount: <T extends object | null>(app: string, path: string, nullIfNotFound?: boolean, tracingConfig?: RequestTracingConfig) => Promise<T>;
26
+ protected getAppJSONByVendor: <T extends object | null>(app: string, path: string, nullIfNotFound?: boolean, tracingConfig?: RequestTracingConfig) => Promise<T>;
27
+ protected getAppFileByAccount: (app: string, path: string, nullIfNotFound?: boolean, tracingConfig?: RequestTracingConfig) => Promise<{
27
28
  data: Buffer;
28
29
  headers: any;
29
30
  }>;
30
- protected getAppFileByVendor: (app: string, path: string, nullIfNotFound?: boolean | undefined, tracingConfig?: RequestTracingConfig | undefined) => Promise<{
31
+ protected getAppFileByVendor: (app: string, path: string, nullIfNotFound?: boolean, tracingConfig?: RequestTracingConfig) => Promise<{
31
32
  data: Buffer;
32
33
  headers: any;
33
34
  }>;
@@ -22,7 +22,7 @@ const dependsOnApp = (appsAtMajor) => (a) => {
22
22
  };
23
23
  const useBuildJson = (app, appVendorName) => {
24
24
  const buildFeatures = app._buildFeatures;
25
- return buildFeatures && buildFeatures[appVendorName] && ramda_1.contains('build.json', buildFeatures[appVendorName]);
25
+ return buildFeatures && buildFeatures[appVendorName] && (0, ramda_1.contains)('build.json', buildFeatures[appVendorName]);
26
26
  };
27
27
  const appOrRegistry = (workspace, { name, version, build }) => build
28
28
  ? `${workspace}/apps/${name}@${version}+${build}`
@@ -35,7 +35,7 @@ class Assets extends InfraClient_1.InfraClient {
35
35
  constructor(context, options) {
36
36
  super('apps@0.x', context, options, true);
37
37
  this.getAppBundleByVendor = (app, bundlePath, generatePackageJson, tracingConfig) => {
38
- const locator = utils_1.parseAppId(app);
38
+ const locator = (0, utils_1.parseAppId)(app);
39
39
  const params = generatePackageJson && { _packageJSONEngine: 'npm', _packageJSONFilter: 'vtex.render-builder@x' };
40
40
  const metric = locator.build ? 'apps-get-bundle' : 'registry-get-bundle';
41
41
  return this.http.getStream(this.routes.Bundle(this.context.account, locator, bundlePath), {
@@ -52,7 +52,7 @@ class Assets extends InfraClient_1.InfraClient {
52
52
  });
53
53
  };
54
54
  this.getAppJSONByAccount = (app, path, nullIfNotFound, tracingConfig) => {
55
- const locator = utils_1.parseAppId(app);
55
+ const locator = (0, utils_1.parseAppId)(app);
56
56
  const inflightKey = HttpClient_1.inflightURL;
57
57
  const metric = 'assets-get-json-by-account';
58
58
  return this.http.get(this.routes.Files(this.context.account, locator, path), {
@@ -67,7 +67,7 @@ class Assets extends InfraClient_1.InfraClient {
67
67
  });
68
68
  };
69
69
  this.getAppJSONByVendor = (app, path, nullIfNotFound, tracingConfig) => {
70
- const locator = utils_1.parseAppId(app);
70
+ const locator = (0, utils_1.parseAppId)(app);
71
71
  const vendor = locator.name.split('.')[0];
72
72
  const inflightKey = HttpClient_1.inflightURL;
73
73
  const metric = 'assets-get-json-by-vendor';
@@ -83,7 +83,7 @@ class Assets extends InfraClient_1.InfraClient {
83
83
  });
84
84
  };
85
85
  this.getAppFileByAccount = (app, path, nullIfNotFound, tracingConfig) => {
86
- const locator = utils_1.parseAppId(app);
86
+ const locator = (0, utils_1.parseAppId)(app);
87
87
  const inflightKey = HttpClient_1.inflightURL;
88
88
  const metric = 'assets-get-file-by-account';
89
89
  return this.http.getBuffer(this.routes.Files(this.context.account, locator, path), {
@@ -98,7 +98,7 @@ class Assets extends InfraClient_1.InfraClient {
98
98
  });
99
99
  };
100
100
  this.getAppFileByVendor = (app, path, nullIfNotFound, tracingConfig) => {
101
- const locator = utils_1.parseAppId(app);
101
+ const locator = (0, utils_1.parseAppId)(app);
102
102
  const vendor = locator.name.split('.')[0];
103
103
  const inflightKey = HttpClient_1.inflightURL;
104
104
  const metric = 'assets-get-file-by-vendor';
@@ -129,7 +129,7 @@ class Assets extends InfraClient_1.InfraClient {
129
129
  async getBuildJSONForApp(app, appVendorName, pick = [], tracingConfig) {
130
130
  const pickArray = Array.isArray(pick) ? pick : [pick];
131
131
  const buildJson = await this.getJSON(app.id, `dist/${appVendorName}/build.json`, undefined, tracingConfig);
132
- const result = !ramda_1.isEmpty(pickArray) ? ramda_1.pick(pickArray, buildJson) : buildJson;
132
+ const result = !(0, ramda_1.isEmpty)(pickArray) ? (0, ramda_1.pick)(pickArray, buildJson) : buildJson;
133
133
  result.declarer = app.id;
134
134
  return result;
135
135
  }
@@ -137,12 +137,12 @@ class Assets extends InfraClient_1.InfraClient {
137
137
  // If there's no support for build.json, then fetch individual files and zip them into an {[file]: content} object.
138
138
  const filesArray = Array.isArray(files) ? files : [files];
139
139
  const fetched = await Promise.all(filesArray.map(file => this.getJSON(app.id, file, true, tracingConfig)));
140
- const result = ramda_1.zipObj(filesArray, fetched);
140
+ const result = (0, ramda_1.zipObj)(filesArray, fetched);
141
141
  result.declarer = app.id;
142
142
  return result;
143
143
  }
144
144
  async getJSON(appId, file, nullIfNotFound, tracingConfig) {
145
- const locator = utils_1.parseAppId(appId);
145
+ const locator = (0, utils_1.parseAppId)(appId);
146
146
  const linked = !!locator.build;
147
147
  if (linked) {
148
148
  return this.getAppJSONByAccount(appId, file, nullIfNotFound, tracingConfig);
@@ -150,7 +150,7 @@ class Assets extends InfraClient_1.InfraClient {
150
150
  return this.getAppJSONByVendor(appId, file, nullIfNotFound, tracingConfig);
151
151
  }
152
152
  async getFile(appId, file, nullIfNotFound, tracingConfig) {
153
- const locator = utils_1.parseAppId(appId);
153
+ const locator = (0, utils_1.parseAppId)(appId);
154
154
  const linked = !!locator.build;
155
155
  if (linked) {
156
156
  return this.getAppFileByAccount(appId, file, nullIfNotFound, tracingConfig);
@@ -160,7 +160,7 @@ class Assets extends InfraClient_1.InfraClient {
160
160
  getFilteredDependencies(apps, dependencies) {
161
161
  const appsAtMajor = typeof (apps) === 'string' ? [apps] : apps;
162
162
  const depends = dependsOnApp(appsAtMajor);
163
- return ramda_1.filter(depends, dependencies);
163
+ return (0, ramda_1.filter)(depends, dependencies);
164
164
  }
165
165
  }
166
166
  exports.Assets = Assets;
@@ -3,7 +3,7 @@ import { IOContext } from '../../service/worker/runtime/typings';
3
3
  import { InfraClient } from './InfraClient';
4
4
  export declare class BillingMetrics extends InfraClient {
5
5
  constructor(context: IOContext, options?: InstanceOptions);
6
- sendMetric: (metric: BillingMetric, tracingConfig?: RequestTracingConfig | undefined) => Promise<BillingMetric>;
6
+ sendMetric: (metric: BillingMetric, tracingConfig?: RequestTracingConfig) => Promise<BillingMetric>;
7
7
  }
8
8
  export interface BillingMetric {
9
9
  value: number;
@@ -3,7 +3,7 @@ import { IOContext } from '../../service/worker/runtime/typings';
3
3
  import { InfraClient } from './InfraClient';
4
4
  export declare class Events extends InfraClient {
5
5
  constructor({ recorder, ...context }: IOContext, options?: InstanceOptions);
6
- sendEvent: (appIdOrResource: string | ResourceVRN, route: string, message?: any, tracingConfig?: RequestTracingConfig | undefined) => Promise<void>;
6
+ sendEvent: (appIdOrResource: string | ResourceVRN, route: string, message?: any, tracingConfig?: RequestTracingConfig) => Promise<void>;
7
7
  private resourceFor;
8
8
  }
9
9
  export interface ResourceVRN {
@@ -5,7 +5,7 @@ const util_1 = require("util");
5
5
  const InfraClient_1 = require("./InfraClient");
6
6
  const ANY_APP = '';
7
7
  const eventRoute = (route) => `/events/${route}`;
8
- const isResourceVRN = (appIdOrResource) => util_1.isObject(appIdOrResource) && !util_1.isNullOrUndefined(appIdOrResource.service);
8
+ const isResourceVRN = (appIdOrResource) => (0, util_1.isObject)(appIdOrResource) && !(0, util_1.isNullOrUndefined)(appIdOrResource.service);
9
9
  class Events extends InfraClient_1.InfraClient {
10
10
  constructor({ recorder, ...context }, options) {
11
11
  super('courier@0.x', context, options);
@@ -4,7 +4,7 @@ import { IOContext } from '../../service/worker/runtime/typings';
4
4
  import { InfraClient } from './InfraClient';
5
5
  export declare class Housekeeper extends InfraClient {
6
6
  constructor(context: IOContext, options?: InstanceOptions);
7
- apply: (data: HousekeeperStatesAndUpdates, tracingConfig?: RequestTracingConfig | undefined) => Promise<void>;
8
- perform: (tracingConfig?: RequestTracingConfig | undefined) => Promise<void>;
9
- resolve: (tracingConfig?: RequestTracingConfig | undefined) => Promise<HousekeeperStatesAndUpdates>;
7
+ apply: (data: HousekeeperStatesAndUpdates, tracingConfig?: RequestTracingConfig) => Promise<void>;
8
+ perform: (tracingConfig?: RequestTracingConfig) => Promise<void>;
9
+ resolve: (tracingConfig?: RequestTracingConfig) => Promise<HousekeeperStatesAndUpdates>;
10
10
  }
@@ -1,32 +1,38 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
2
4
  import { IncomingMessage } from 'http';
3
5
  import { Readable, Writable } from 'stream';
4
6
  import { ZlibOptions } from 'zlib';
5
7
  import { InstanceOptions, RequestTracingConfig } from '../../HttpClient';
6
- import { AppBundlePublished, AppFilesList, AppManifest, AppState } from '../../responses';
8
+ import { AppFilesList, AppManifest, AppState } from '../../responses';
7
9
  import { IOContext } from '../../service/worker/runtime/typings';
8
10
  import { InfraClient } from './InfraClient';
9
11
  export declare class Registry extends InfraClient {
10
12
  constructor(context: IOContext, options?: InstanceOptions);
11
- getAppState: (app: string, version: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<AppState>;
12
- publishApp: (files: File[], tag?: string | undefined, { zlib }?: ZipOptions, tracingConfig?: RequestTracingConfig | undefined) => Promise<AppBundlePublished>;
13
- publishAppRc: (files: File[], tag?: string | undefined, { zlib }?: ZipOptions, tracingConfig?: RequestTracingConfig | undefined) => Promise<AppBundlePublished>;
14
- listApps: (tracingConfig?: RequestTracingConfig | undefined) => Promise<RegistryAppsList>;
15
- listVersionsByApp: (app: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<RegistryAppVersionsList>;
16
- deprecateApp: (app: string, version: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<void>;
17
- undeprecateApp: (app: string, version: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<void>;
18
- validateApp: (app: string, version: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<void>;
19
- getAppManifest: (app: string, version: string, opts?: AppsManifestOptions | undefined, tracingConfig?: RequestTracingConfig | undefined) => Promise<AppManifest>;
20
- listAppFiles: (app: string, version: string, opts?: ListAppFilesOptions | undefined, tracingConfig?: RequestTracingConfig | undefined) => Promise<AppFilesList>;
21
- getAppFile: (app: string, version: string, path: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<{
13
+ getAppState: (app: string, version: string, tracingConfig?: RequestTracingConfig) => Promise<AppState>;
14
+ publishApp: (files: File[], tag?: string, { zlib }?: ZipOptions, tracingConfig?: RequestTracingConfig) => Promise<import("../../responses").AppBundleResponse & {
15
+ bundleSize?: number | undefined;
16
+ }>;
17
+ publishAppRc: (files: File[], tag?: string, { zlib }?: ZipOptions, tracingConfig?: RequestTracingConfig) => Promise<import("../../responses").AppBundleResponse & {
18
+ bundleSize?: number | undefined;
19
+ }>;
20
+ listApps: (tracingConfig?: RequestTracingConfig) => Promise<RegistryAppsList>;
21
+ listVersionsByApp: (app: string, tracingConfig?: RequestTracingConfig) => Promise<RegistryAppVersionsList>;
22
+ deprecateApp: (app: string, version: string, tracingConfig?: RequestTracingConfig) => Promise<void>;
23
+ undeprecateApp: (app: string, version: string, tracingConfig?: RequestTracingConfig) => Promise<void>;
24
+ validateApp: (app: string, version: string, tracingConfig?: RequestTracingConfig) => Promise<void>;
25
+ getAppManifest: (app: string, version: string, opts?: AppsManifestOptions, tracingConfig?: RequestTracingConfig) => Promise<AppManifest>;
26
+ listAppFiles: (app: string, version: string, opts?: ListAppFilesOptions, tracingConfig?: RequestTracingConfig) => Promise<AppFilesList>;
27
+ getAppFile: (app: string, version: string, path: string, tracingConfig?: RequestTracingConfig) => Promise<{
22
28
  data: Buffer;
23
29
  headers: any;
24
30
  }>;
25
- getAppJSON: <T extends object | null>(app: string, version: string, path: string, nullIfNotFound?: boolean | undefined, tracingConfig?: RequestTracingConfig | undefined) => Promise<T>;
26
- getAppFileStream: (app: string, version: string, path: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<IncomingMessage>;
27
- getAppBundle: (app: string, version: string, bundlePath: string, generatePackageJson: boolean, tracingConfig?: RequestTracingConfig | undefined) => Promise<Readable>;
28
- unpackAppBundle: (app: string, version: string, bundlePath: string, unpackPath: string, generatePackageJson: boolean, tracingConfig?: RequestTracingConfig | undefined) => Promise<Writable>;
29
- resolveDependenciesWithManifest: (manifest: AppManifest, filter?: string, tracingConfig?: RequestTracingConfig | undefined) => Promise<Record<string, string[]>>;
31
+ getAppJSON: <T extends object | null>(app: string, version: string, path: string, nullIfNotFound?: boolean, tracingConfig?: RequestTracingConfig) => Promise<T>;
32
+ getAppFileStream: (app: string, version: string, path: string, tracingConfig?: RequestTracingConfig) => Promise<IncomingMessage>;
33
+ getAppBundle: (app: string, version: string, bundlePath: string, generatePackageJson: boolean, tracingConfig?: RequestTracingConfig) => Promise<Readable>;
34
+ unpackAppBundle: (app: string, version: string, bundlePath: string, unpackPath: string, generatePackageJson: boolean, tracingConfig?: RequestTracingConfig) => Promise<Writable>;
35
+ resolveDependenciesWithManifest: (manifest: AppManifest, filter?: string, tracingConfig?: RequestTracingConfig) => Promise<Record<string, string[]>>;
30
36
  private publish;
31
37
  }
32
38
  interface ZipOptions {