@vtex/api 6.48.1-beta → 6.48.1-beta.2
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/gen/manifest.schema +5 -3
- package/lib/HttpClient/GraphQLClient.d.ts +3 -2
- package/lib/HttpClient/GraphQLClient.js +5 -1
- package/lib/HttpClient/HttpClient.d.ts +9 -7
- package/lib/HttpClient/HttpClient.js +70 -27
- package/lib/HttpClient/agents.d.ts +6 -0
- package/lib/HttpClient/agents.js +43 -0
- package/lib/HttpClient/index.d.ts +1 -7
- package/lib/HttpClient/index.js +22 -16
- package/lib/HttpClient/middlewares/cache.d.ts +9 -3
- package/lib/HttpClient/middlewares/cache.js +130 -35
- package/lib/HttpClient/middlewares/cancellationToken.d.ts +2 -2
- package/lib/HttpClient/middlewares/cancellationToken.js +5 -2
- package/lib/HttpClient/middlewares/inflight.d.ts +1 -1
- package/lib/HttpClient/middlewares/inflight.js +7 -3
- package/lib/HttpClient/middlewares/memoization.d.ts +1 -1
- package/lib/HttpClient/middlewares/memoization.js +13 -4
- package/lib/HttpClient/middlewares/metrics.js +25 -38
- package/lib/HttpClient/middlewares/notFound.d.ts +1 -1
- package/lib/HttpClient/middlewares/notFound.js +5 -2
- package/lib/HttpClient/middlewares/recorder.d.ts +1 -1
- package/lib/HttpClient/middlewares/recorder.js +21 -12
- package/lib/HttpClient/middlewares/request/HttpAgentSingleton.d.ts +11 -0
- package/lib/HttpClient/middlewares/request/HttpAgentSingleton.js +31 -0
- package/lib/HttpClient/middlewares/request/index.d.ts +18 -0
- package/lib/HttpClient/middlewares/request/index.js +88 -0
- package/lib/HttpClient/middlewares/request/setupAxios/index.d.ts +1 -0
- package/lib/HttpClient/middlewares/request/setupAxios/index.js +22 -0
- package/lib/HttpClient/middlewares/request/setupAxios/interceptors/exponentialBackoff.d.ts +2 -0
- package/lib/HttpClient/middlewares/request/setupAxios/interceptors/exponentialBackoff.js +55 -0
- package/lib/HttpClient/middlewares/request/setupAxios/interceptors/index.d.ts +2 -0
- package/lib/HttpClient/middlewares/request/setupAxios/interceptors/index.js +8 -0
- package/lib/HttpClient/middlewares/request/setupAxios/interceptors/tracing/index.d.ts +8 -0
- package/lib/HttpClient/middlewares/request/setupAxios/interceptors/tracing/index.js +56 -0
- package/lib/HttpClient/middlewares/request/setupAxios/interceptors/tracing/spanSetup.d.ts +4 -0
- package/lib/HttpClient/middlewares/request/setupAxios/interceptors/tracing/spanSetup.js +32 -0
- package/lib/HttpClient/middlewares/tracing.d.ts +15 -0
- package/lib/HttpClient/middlewares/tracing.js +62 -0
- package/lib/HttpClient/typings.d.ts +46 -12
- package/lib/HttpClient/typings.js +1 -0
- package/lib/caches/DiskCache.d.ts +1 -1
- package/lib/caches/DiskCache.js +3 -2
- package/lib/caches/LRUCache.d.ts +3 -3
- package/lib/caches/LRUCache.js +6 -1
- package/lib/caches/LRUDiskCache.d.ts +2 -2
- package/lib/caches/LRUDiskCache.js +8 -3
- package/lib/caches/MultilayeredCache.d.ts +2 -2
- package/lib/caches/MultilayeredCache.js +8 -7
- package/lib/caches/index.js +20 -7
- package/lib/caches/typings.d.ts +5 -5
- package/lib/clients/IOClient.d.ts +13 -0
- package/lib/clients/IOClient.js +20 -0
- package/lib/clients/IOClients.d.ts +29 -25
- package/lib/clients/IOClients.js +36 -28
- package/lib/{HttpClient → clients}/IOGraphQLClient.d.ts +4 -4
- package/lib/{HttpClient → clients}/IOGraphQLClient.js +3 -2
- package/lib/{HttpClient → clients/apps}/AppClient.d.ts +3 -3
- package/lib/{HttpClient → clients/apps}/AppClient.js +11 -5
- package/lib/{HttpClient → clients/apps}/AppGraphQLClient.d.ts +3 -3
- package/lib/{HttpClient → clients/apps}/AppGraphQLClient.js +11 -5
- package/lib/clients/apps/Billing.d.ts +12 -0
- package/lib/clients/{Billing.js → apps/Billing.js} +9 -3
- package/lib/clients/{Builder.d.ts → apps/Builder.d.ts} +12 -11
- package/lib/clients/{Builder.js → apps/Builder.js} +51 -23
- package/lib/clients/apps/MessagesGraphQL.d.ts +61 -0
- package/lib/clients/apps/MessagesGraphQL.js +122 -0
- package/lib/clients/{Settings.d.ts → apps/Settings.d.ts} +5 -4
- package/lib/clients/apps/Settings.js +39 -0
- package/lib/clients/apps/catalogGraphQL/brand.d.ts +13 -0
- package/lib/clients/apps/catalogGraphQL/brand.js +19 -0
- package/lib/clients/apps/catalogGraphQL/category.d.ts +11 -0
- package/lib/clients/apps/catalogGraphQL/category.js +17 -0
- package/lib/clients/apps/catalogGraphQL/index.d.ts +22 -0
- package/lib/clients/apps/catalogGraphQL/index.js +89 -0
- package/lib/clients/apps/catalogGraphQL/product.d.ts +25 -0
- package/lib/clients/apps/catalogGraphQL/product.js +31 -0
- package/lib/clients/apps/catalogGraphQL/sku.d.ts +26 -0
- package/lib/clients/apps/catalogGraphQL/sku.js +31 -0
- package/lib/clients/apps/index.d.ts +7 -0
- package/lib/clients/apps/index.js +23 -0
- package/lib/{HttpClient → clients/external}/ExternalClient.d.ts +3 -3
- package/lib/{HttpClient → clients/external}/ExternalClient.js +10 -2
- package/lib/clients/external/ID.d.ts +23 -0
- package/lib/clients/external/ID.js +61 -0
- package/lib/clients/external/Masterdata.d.ts +94 -0
- package/lib/clients/external/Masterdata.js +225 -0
- package/lib/clients/external/PaymentProvider.d.ts +31 -0
- package/lib/clients/external/PaymentProvider.js +43 -0
- package/lib/clients/external/index.d.ts +4 -0
- package/lib/clients/external/index.js +20 -0
- package/lib/clients/index.d.ts +9 -21
- package/lib/clients/index.js +27 -24
- package/lib/clients/infra/Apps.d.ts +93 -0
- package/lib/clients/infra/Apps.js +511 -0
- package/lib/clients/infra/Assets.d.ts +35 -0
- package/lib/clients/infra/Assets.js +166 -0
- package/lib/clients/infra/BillingMetrics.d.ts +13 -0
- package/lib/clients/infra/BillingMetrics.js +16 -0
- package/lib/clients/infra/Events.d.ts +12 -0
- package/lib/clients/infra/Events.js +34 -0
- package/lib/clients/infra/Housekeeper.d.ts +10 -0
- package/lib/clients/infra/Housekeeper.js +31 -0
- package/lib/{HttpClient → clients/infra}/InfraClient.d.ts +3 -3
- package/lib/{HttpClient → clients/infra}/InfraClient.js +10 -4
- package/lib/clients/infra/Registry.d.ts +65 -0
- package/lib/clients/infra/Registry.js +209 -0
- package/lib/clients/infra/Router.d.ts +34 -0
- package/lib/clients/infra/Router.js +82 -0
- package/lib/clients/infra/Sphinx.d.ts +13 -0
- package/lib/clients/infra/Sphinx.js +30 -0
- package/lib/clients/infra/VBase.d.ts +61 -0
- package/lib/clients/infra/VBase.js +197 -0
- package/lib/clients/infra/Workspaces.d.ts +18 -0
- package/lib/clients/infra/Workspaces.js +66 -0
- package/lib/clients/infra/index.d.ts +11 -0
- package/lib/clients/infra/index.js +27 -0
- package/lib/{HttpClient → clients/janus}/JanusClient.d.ts +4 -4
- package/lib/{HttpClient → clients/janus}/JanusClient.js +8 -3
- package/lib/clients/janus/LicenseManager.d.ts +7 -0
- package/lib/clients/janus/LicenseManager.js +59 -0
- package/lib/clients/{Segment.d.ts → janus/Segment.d.ts} +7 -11
- package/lib/clients/janus/Segment.js +89 -0
- package/lib/clients/{Session.d.ts → janus/Session.d.ts} +4 -4
- package/lib/clients/{Session.js → janus/Session.js} +25 -13
- package/lib/clients/{Tenant.d.ts → janus/Tenant.d.ts} +7 -8
- package/lib/clients/janus/Tenant.js +29 -0
- package/lib/clients/janus/index.d.ts +5 -0
- package/lib/clients/janus/index.js +21 -0
- package/lib/constants.d.ts +50 -2
- package/lib/constants.js +55 -1
- package/lib/errors/AuthenticationError.js +1 -0
- package/lib/errors/ForbiddenError.js +1 -0
- package/lib/errors/NotFoundError.js +1 -0
- package/lib/errors/RequestCancelledError.js +1 -0
- package/lib/errors/ResolverError.d.ts +1 -1
- package/lib/errors/ResolverError.js +4 -3
- package/lib/errors/ResolverWarning.d.ts +1 -1
- package/lib/errors/ResolverWarning.js +3 -2
- package/lib/errors/TooManyRequestsError.js +1 -0
- package/lib/errors/UserInputError.js +1 -0
- package/lib/errors/index.js +22 -11
- package/lib/index.d.ts +9 -7
- package/lib/index.js +31 -16
- package/lib/metrics/MetricsAccumulator.d.ts +3 -20
- package/lib/metrics/MetricsAccumulator.js +44 -27
- package/lib/responses.d.ts +5 -46
- package/lib/service/index.d.ts +2 -0
- package/lib/service/index.js +35 -0
- package/lib/service/loaders.d.ts +8 -0
- package/lib/service/loaders.js +57 -0
- package/lib/service/logger/console.d.ts +10 -0
- package/lib/service/logger/console.js +40 -0
- package/lib/service/logger/index.d.ts +2 -28
- package/lib/service/logger/index.js +16 -68
- package/lib/service/logger/logger.d.ts +29 -0
- package/lib/service/logger/logger.js +62 -0
- package/lib/service/logger/metricsLogger.d.ts +40 -0
- package/lib/service/logger/metricsLogger.js +150 -0
- package/lib/service/master.d.ts +2 -0
- package/lib/service/master.js +89 -0
- package/lib/service/metrics/requestMetricsMiddleware.d.ts +2 -0
- package/lib/service/metrics/requestMetricsMiddleware.js +46 -0
- package/lib/service/tracing/TracerSingleton.d.ts +7 -0
- package/lib/service/tracing/TracerSingleton.js +49 -0
- package/lib/service/tracing/metrics/MetricNames.d.ts +60 -0
- package/lib/service/tracing/metrics/MetricNames.js +45 -0
- package/lib/service/tracing/metrics/instruments.d.ts +9 -0
- package/lib/service/tracing/metrics/instruments.js +19 -0
- package/lib/service/tracing/metrics/measurers/EventLoopLagMeasurer.d.ts +9 -0
- package/lib/service/tracing/metrics/measurers/EventLoopLagMeasurer.js +26 -0
- package/lib/service/tracing/tracingMiddlewares.d.ts +5 -0
- package/lib/service/tracing/tracingMiddlewares.js +117 -0
- package/lib/service/worker/index.d.ts +11 -0
- package/lib/service/worker/index.js +197 -0
- package/lib/service/worker/listeners.d.ts +3 -0
- package/lib/{utils/unhandled.js → service/worker/listeners.js} +12 -16
- package/lib/service/{Service.d.ts → worker/runtime/Service.d.ts} +5 -5
- package/lib/service/{Service.js → worker/runtime/Service.js} +3 -1
- package/lib/service/worker/runtime/builtIn/handlers.d.ts +4 -0
- package/lib/service/worker/runtime/builtIn/handlers.js +34 -0
- package/lib/service/worker/runtime/builtIn/middlewares.d.ts +4 -0
- package/lib/service/worker/runtime/builtIn/middlewares.js +43 -0
- package/lib/service/worker/runtime/events/index.d.ts +4 -0
- package/lib/service/worker/runtime/events/index.js +48 -0
- package/lib/service/worker/runtime/events/middlewares/body.d.ts +3 -0
- package/lib/service/worker/runtime/events/middlewares/body.js +26 -0
- package/lib/service/worker/runtime/events/middlewares/context.d.ts +3 -0
- package/lib/service/worker/runtime/events/middlewares/context.js +23 -0
- package/lib/service/worker/runtime/events/router.d.ts +2 -0
- package/lib/service/worker/runtime/events/router.js +29 -0
- package/lib/service/worker/runtime/graphql/index.d.ts +6 -0
- package/lib/service/worker/runtime/graphql/index.js +29 -0
- package/lib/service/worker/runtime/graphql/middlewares/context.d.ts +2 -0
- package/lib/service/worker/runtime/graphql/middlewares/context.js +17 -0
- package/lib/service/worker/runtime/graphql/middlewares/error.js +97 -0
- package/lib/service/worker/runtime/graphql/middlewares/query.d.ts +3 -0
- package/lib/service/worker/runtime/graphql/middlewares/query.js +54 -0
- package/lib/service/worker/runtime/graphql/middlewares/response.js +39 -0
- package/lib/service/worker/runtime/graphql/middlewares/run.d.ts +2 -0
- package/lib/service/worker/runtime/graphql/middlewares/run.js +21 -0
- package/lib/service/worker/runtime/graphql/middlewares/updateSchema.d.ts +5 -0
- package/lib/service/worker/runtime/graphql/middlewares/updateSchema.js +30 -0
- package/lib/service/worker/runtime/graphql/middlewares/upload.d.ts +4 -0
- package/lib/service/{graphql → worker/runtime/graphql}/middlewares/upload.js +2 -1
- package/lib/service/worker/runtime/graphql/schema/index.d.ts +7 -0
- package/lib/service/worker/runtime/graphql/schema/index.js +33 -0
- package/lib/service/worker/runtime/graphql/schema/messagesLoaderV2.d.ts +6 -0
- package/lib/service/worker/runtime/graphql/schema/messagesLoaderV2.js +81 -0
- package/lib/service/{graphql → worker/runtime/graphql}/schema/schemaDirectives/Auth.d.ts +1 -0
- package/lib/service/{graphql → worker/runtime/graphql}/schema/schemaDirectives/Auth.js +17 -10
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/CacheControl.d.ts +7 -0
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/CacheControl.js +38 -0
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/Deprecated.d.ts +11 -0
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/Deprecated.js +62 -0
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/Metric.d.ts +7 -0
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/Metric.js +41 -0
- package/lib/service/{graphql → worker/runtime/graphql}/schema/schemaDirectives/Sanitize.d.ts +1 -0
- package/lib/service/{graphql → worker/runtime/graphql}/schema/schemaDirectives/Sanitize.js +7 -0
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/Settings.d.ts +6 -0
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/Settings.js +35 -0
- package/lib/service/{graphql → worker/runtime/graphql}/schema/schemaDirectives/SmartCacheDirective.d.ts +1 -0
- package/lib/service/{graphql → worker/runtime/graphql}/schema/schemaDirectives/SmartCacheDirective.js +9 -3
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/TranslatableV2.d.ts +7 -0
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/TranslatableV2.js +40 -0
- package/lib/service/{graphql/schema/schemaDirectives/Translatable.d.ts → worker/runtime/graphql/schema/schemaDirectives/TranslateTo.d.ts} +2 -1
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/TranslateTo.js +34 -0
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/index.d.ts +22 -0
- package/lib/service/worker/runtime/graphql/schema/schemaDirectives/index.js +37 -0
- package/lib/service/worker/runtime/graphql/schema/typeDefs/index.d.ts +8 -0
- package/lib/service/worker/runtime/graphql/schema/typeDefs/index.js +14 -0
- package/lib/service/{graphql → worker/runtime/graphql}/schema/typeDefs/ioUpload.js +1 -0
- package/lib/service/{graphql → worker/runtime/graphql}/schema/typeDefs/sanitizedString.js +8 -3
- package/lib/service/worker/runtime/graphql/typings.d.ts +31 -0
- package/lib/service/worker/runtime/graphql/utils/cacheControl.d.ts +2 -0
- package/lib/service/worker/runtime/graphql/utils/cacheControl.js +34 -0
- package/lib/service/worker/runtime/graphql/utils/error.d.ts +2 -0
- package/lib/service/worker/runtime/graphql/utils/error.js +78 -0
- package/lib/service/worker/runtime/graphql/utils/pathname.js +9 -0
- package/lib/service/worker/runtime/graphql/utils/translations.d.ts +14 -0
- package/lib/service/worker/runtime/graphql/utils/translations.js +42 -0
- package/lib/service/worker/runtime/http/index.d.ts +5 -0
- package/lib/service/worker/runtime/http/index.js +61 -0
- package/lib/service/worker/runtime/http/middlewares/authTokens.d.ts +3 -0
- package/lib/service/{http → worker/runtime/http}/middlewares/authTokens.js +1 -0
- package/lib/service/worker/runtime/http/middlewares/cancellationToken.d.ts +3 -0
- package/lib/service/{http → worker/runtime/http}/middlewares/cancellationToken.js +3 -1
- package/lib/service/worker/runtime/http/middlewares/clients.d.ts +4 -0
- package/lib/service/{http → worker/runtime/http}/middlewares/clients.js +1 -0
- package/lib/service/worker/runtime/http/middlewares/context.d.ts +4 -0
- package/lib/service/worker/runtime/http/middlewares/context.js +39 -0
- package/lib/service/worker/runtime/http/middlewares/error.d.ts +2 -0
- package/lib/service/{http → worker/runtime/http}/middlewares/error.js +29 -16
- package/lib/service/worker/runtime/http/middlewares/rateLimit.d.ts +6 -0
- package/lib/service/worker/runtime/http/middlewares/rateLimit.js +43 -0
- package/lib/service/{http → worker/runtime/http}/middlewares/requestStats.d.ts +3 -3
- package/lib/service/{http → worker/runtime/http}/middlewares/requestStats.js +1 -0
- package/lib/service/worker/runtime/http/middlewares/setCookie.d.ts +3 -0
- package/lib/service/{http → worker/runtime/http}/middlewares/setCookie.js +6 -5
- package/lib/service/worker/runtime/http/middlewares/settings.d.ts +9 -0
- package/lib/service/worker/runtime/http/middlewares/settings.js +49 -0
- package/lib/service/worker/runtime/http/middlewares/timings.d.ts +3 -0
- package/lib/service/{http → worker/runtime/http}/middlewares/timings.js +25 -11
- package/lib/service/worker/runtime/http/middlewares/vary.d.ts +3 -0
- package/lib/service/{http → worker/runtime/http}/middlewares/vary.js +4 -3
- package/lib/service/worker/runtime/http/router.d.ts +2 -0
- package/lib/service/worker/runtime/http/router.js +25 -0
- package/lib/service/worker/runtime/http/routes.d.ts +19 -0
- package/lib/service/worker/runtime/http/routes.js +16 -0
- package/lib/service/worker/runtime/method.d.ts +9 -0
- package/lib/service/{method.js → worker/runtime/method.js} +2 -1
- package/lib/service/worker/runtime/statusTrack.d.ts +14 -0
- package/lib/service/worker/runtime/statusTrack.js +43 -0
- package/lib/service/worker/runtime/typings.d.ts +173 -0
- package/lib/service/worker/runtime/utils/compose.d.ts +5 -0
- package/lib/service/worker/runtime/utils/compose.js +14 -0
- package/lib/service/worker/runtime/utils/context.d.ts +5 -0
- package/lib/service/worker/runtime/utils/context.js +42 -0
- package/lib/service/worker/runtime/utils/diff.d.ts +12 -0
- package/lib/service/worker/runtime/utils/diff.js +22 -0
- package/lib/service/worker/runtime/utils/recorder.d.ts +8 -0
- package/lib/service/worker/runtime/utils/recorder.js +38 -0
- package/lib/service/worker/runtime/utils/toArray.js +5 -0
- package/lib/service/worker/runtime/utils/tokenBucket.d.ts +2 -0
- package/lib/service/worker/runtime/utils/tokenBucket.js +17 -0
- package/lib/tracing/LogEvents.d.ts +31 -0
- package/lib/{service/graphql/utils/array.js → tracing/LogEvents.js} +1 -1
- package/lib/tracing/LogFields.d.ts +66 -0
- package/lib/tracing/LogFields.js +3 -0
- package/lib/tracing/Tags.d.ts +81 -0
- package/lib/tracing/Tags.js +8 -0
- package/lib/tracing/UserLandTracer.d.ts +27 -0
- package/lib/tracing/UserLandTracer.js +58 -0
- package/lib/tracing/errorReporting/ErrorReport.d.ts +31 -0
- package/lib/tracing/errorReporting/ErrorReport.js +71 -0
- package/lib/tracing/index.d.ts +9 -0
- package/lib/tracing/index.js +20 -0
- package/lib/tracing/spanReference/SpanReferenceTypes.d.ts +4 -0
- package/lib/tracing/spanReference/SpanReferenceTypes.js +8 -0
- package/lib/tracing/spanReference/createSpanReference.d.ts +3 -0
- package/lib/tracing/spanReference/createSpanReference.js +9 -0
- package/lib/tracing/utils.d.ts +13 -0
- package/lib/tracing/utils.js +42 -0
- package/lib/utils/MineWinsConflictsResolver.d.ts +7 -5
- package/lib/utils/MineWinsConflictsResolver.js +40 -22
- package/lib/utils/app.d.ts +3 -1
- package/lib/utils/app.js +40 -21
- package/lib/utils/appsStaleIfError.d.ts +2 -1
- package/lib/utils/appsStaleIfError.js +33 -12
- package/lib/utils/billingOptions.d.ts +36 -3
- package/lib/utils/billingOptions.js +9 -3
- package/lib/utils/binding.d.ts +3 -3
- package/lib/utils/binding.js +5 -2
- package/lib/utils/cancel.d.ts +2 -2
- package/lib/utils/cancel.js +3 -1
- package/lib/utils/conflicts.mock.d.ts +17 -0
- package/lib/utils/conflicts.mock.js +28 -0
- package/lib/utils/domain.js +2 -1
- package/lib/utils/error.js +6 -4
- package/lib/utils/index.js +23 -12
- package/lib/utils/json.js +1 -0
- package/lib/utils/log.d.ts +1 -3
- package/lib/utils/log.js +6 -4
- package/lib/utils/message.js +11 -4
- package/lib/utils/renameBy.js +3 -1
- package/lib/utils/retry.js +10 -7
- package/lib/utils/status.js +3 -1
- package/lib/utils/tenant.d.ts +3 -3
- package/lib/utils/tenant.js +5 -2
- package/lib/utils/throwOnGraphQLErrors.js +1 -0
- package/lib/utils/time.d.ts +7 -7
- package/lib/utils/time.js +29 -12
- package/package.json +3 -3
- package/lib/HttpClient/IOClient.d.ts +0 -13
- package/lib/HttpClient/IOClient.js +0 -14
- package/lib/HttpClient/factories/index.d.ts +0 -8
- package/lib/HttpClient/factories/index.js +0 -31
- package/lib/HttpClient/middlewares/request.d.ts +0 -10
- package/lib/HttpClient/middlewares/request.js +0 -87
- package/lib/IODataSource.d.ts +0 -27
- package/lib/IODataSource.js +0 -46
- package/lib/clients/Apps.d.ts +0 -84
- package/lib/clients/Apps.js +0 -326
- package/lib/clients/Assets.d.ts +0 -21
- package/lib/clients/Assets.js +0 -110
- package/lib/clients/Billing.d.ts +0 -11
- package/lib/clients/BillingMetrics.d.ts +0 -12
- package/lib/clients/BillingMetrics.js +0 -10
- package/lib/clients/Events.d.ts +0 -6
- package/lib/clients/Events.js +0 -19
- package/lib/clients/Housekeeper.d.ts +0 -11
- package/lib/clients/Housekeeper.js +0 -24
- package/lib/clients/ID.d.ts +0 -22
- package/lib/clients/ID.js +0 -48
- package/lib/clients/LicenseManager.d.ts +0 -6
- package/lib/clients/LicenseManager.js +0 -43
- package/lib/clients/Logger.d.ts +0 -27
- package/lib/clients/Logger.js +0 -32
- package/lib/clients/Messages.d.ts +0 -18
- package/lib/clients/Messages.js +0 -20
- package/lib/clients/MessagesGraphQL.d.ts +0 -63
- package/lib/clients/MessagesGraphQL.js +0 -50
- package/lib/clients/Metadata.d.ts +0 -25
- package/lib/clients/Metadata.js +0 -53
- package/lib/clients/Registry.d.ts +0 -61
- package/lib/clients/Registry.js +0 -147
- package/lib/clients/Router.d.ts +0 -33
- package/lib/clients/Router.js +0 -50
- package/lib/clients/Segment.js +0 -69
- package/lib/clients/Settings.js +0 -44
- package/lib/clients/Sphinx.d.ts +0 -12
- package/lib/clients/Sphinx.js +0 -19
- package/lib/clients/Tenant.js +0 -13
- package/lib/clients/VBase.d.ts +0 -57
- package/lib/clients/VBase.js +0 -116
- package/lib/clients/Workspaces.d.ts +0 -17
- package/lib/clients/Workspaces.js +0 -38
- package/lib/service/Runtime.d.ts +0 -18
- package/lib/service/Runtime.js +0 -57
- package/lib/service/events/index.d.ts +0 -3
- package/lib/service/events/index.js +0 -21
- package/lib/service/graphql/index.d.ts +0 -7
- package/lib/service/graphql/index.js +0 -33
- package/lib/service/graphql/middlewares/error.js +0 -107
- package/lib/service/graphql/middlewares/formatters.d.ts +0 -2
- package/lib/service/graphql/middlewares/formatters.js +0 -64
- package/lib/service/graphql/middlewares/query.d.ts +0 -2
- package/lib/service/graphql/middlewares/query.js +0 -32
- package/lib/service/graphql/middlewares/response.js +0 -36
- package/lib/service/graphql/middlewares/run.d.ts +0 -4
- package/lib/service/graphql/middlewares/run.js +0 -55
- package/lib/service/graphql/middlewares/schema.d.ts +0 -2
- package/lib/service/graphql/middlewares/schema.js +0 -8
- package/lib/service/graphql/middlewares/timings.d.ts +0 -2
- package/lib/service/graphql/middlewares/timings.js +0 -10
- package/lib/service/graphql/middlewares/upload.d.ts +0 -7
- package/lib/service/graphql/schema/index.d.ts +0 -3
- package/lib/service/graphql/schema/index.js +0 -66
- package/lib/service/graphql/schema/messagesLoader.d.ts +0 -4
- package/lib/service/graphql/schema/messagesLoader.js +0 -41
- package/lib/service/graphql/schema/messagesLoaderV2.d.ts +0 -5
- package/lib/service/graphql/schema/messagesLoaderV2.js +0 -44
- package/lib/service/graphql/schema/schemaDirectives/Translatable.js +0 -54
- package/lib/service/graphql/schema/schemaDirectives/TranslatableV2.d.ts +0 -13
- package/lib/service/graphql/schema/schemaDirectives/TranslatableV2.js +0 -67
- package/lib/service/graphql/schema/schemaDirectives/index.d.ts +0 -13
- package/lib/service/graphql/schema/schemaDirectives/index.js +0 -17
- package/lib/service/graphql/schema/typeDefs/index.d.ts +0 -16
- package/lib/service/graphql/schema/typeDefs/index.js +0 -21
- package/lib/service/graphql/schema/typeDefs/ioMessage.d.ts +0 -8
- package/lib/service/graphql/schema/typeDefs/ioMessage.js +0 -33
- package/lib/service/graphql/typings.d.ts +0 -21
- package/lib/service/graphql/utils/cacheControl.d.ts +0 -6
- package/lib/service/graphql/utils/cacheControl.js +0 -38
- package/lib/service/graphql/utils/maxAgeEnum.d.ts +0 -6
- package/lib/service/graphql/utils/maxAgeEnum.js +0 -17
- package/lib/service/graphql/utils/pathname.js +0 -7
- package/lib/service/http/index.d.ts +0 -3
- package/lib/service/http/index.js +0 -18
- package/lib/service/http/middlewares/authTokens.d.ts +0 -3
- package/lib/service/http/middlewares/cancellationToken.d.ts +0 -3
- package/lib/service/http/middlewares/clients.d.ts +0 -4
- package/lib/service/http/middlewares/error.d.ts +0 -3
- package/lib/service/http/middlewares/setCookie.d.ts +0 -3
- package/lib/service/http/middlewares/timings.d.ts +0 -3
- package/lib/service/http/middlewares/vary.d.ts +0 -3
- package/lib/service/method.d.ts +0 -9
- package/lib/service/typings.d.ts +0 -139
- package/lib/service/utils/compose.d.ts +0 -4
- package/lib/service/utils/compose.js +0 -11
- package/lib/utils/MineWinsConflictsResolver.test.d.ts +0 -1
- package/lib/utils/MineWinsConflictsResolver.test.js +0 -134
- package/lib/utils/unhandled.d.ts +0 -1
- /package/lib/service/{graphql → worker/runtime/graphql}/middlewares/error.d.ts +0 -0
- /package/lib/service/{graphql → worker/runtime/graphql}/middlewares/response.d.ts +0 -0
- /package/lib/service/{graphql → worker/runtime/graphql}/schema/typeDefs/ioUpload.d.ts +0 -0
- /package/lib/service/{graphql → worker/runtime/graphql}/schema/typeDefs/sanitizedString.d.ts +0 -0
- /package/lib/service/{graphql → worker/runtime/graphql}/typings.js +0 -0
- /package/lib/service/{graphql → worker/runtime/graphql}/utils/pathname.d.ts +0 -0
- /package/lib/service/{typings.js → worker/runtime/typings.js} +0 -0
- /package/lib/service/{graphql/utils/array.d.ts → worker/runtime/utils/toArray.d.ts} +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ID = void 0;
|
|
4
|
+
const ExternalClient_1 = require("./ExternalClient");
|
|
5
|
+
const routes = {
|
|
6
|
+
SEND: '/accesskey/send',
|
|
7
|
+
START: '/start',
|
|
8
|
+
VALIDATE: '/accesskey/validate',
|
|
9
|
+
VALIDATE_CLASSIC: '/classic/validate',
|
|
10
|
+
};
|
|
11
|
+
const VTEXID_ENDPOINTS = {
|
|
12
|
+
STABLE: 'https://vtexid.vtex.com.br/api/vtexid/pub/authentication',
|
|
13
|
+
};
|
|
14
|
+
const endpoint = (env) => {
|
|
15
|
+
return VTEXID_ENDPOINTS[env] || env;
|
|
16
|
+
};
|
|
17
|
+
class ID extends ExternalClient_1.ExternalClient {
|
|
18
|
+
constructor(context, opts) {
|
|
19
|
+
super(endpoint(VTEXID_ENDPOINTS.STABLE), context, opts);
|
|
20
|
+
this.getTemporaryToken = (tracingConfig) => {
|
|
21
|
+
const metric = 'vtexid-temp-token';
|
|
22
|
+
return this.http.get(routes.START, { metric, tracing: {
|
|
23
|
+
requestSpanNameSuffix: metric,
|
|
24
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
25
|
+
} }).then(({ authenticationToken }) => authenticationToken);
|
|
26
|
+
};
|
|
27
|
+
this.sendCodeToEmail = (token, email, tracingConfig) => {
|
|
28
|
+
const params = { authenticationToken: token, email };
|
|
29
|
+
const metric = 'vtexid-send-code';
|
|
30
|
+
return this.http.get(routes.SEND, { metric, params, tracing: {
|
|
31
|
+
requestSpanNameSuffix: metric,
|
|
32
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
33
|
+
} });
|
|
34
|
+
};
|
|
35
|
+
this.getEmailCodeAuthenticationToken = (token, email, code, tracingConfig) => {
|
|
36
|
+
const params = {
|
|
37
|
+
accesskey: code,
|
|
38
|
+
authenticationToken: token,
|
|
39
|
+
login: email,
|
|
40
|
+
};
|
|
41
|
+
const metric = 'vtexid-email-token';
|
|
42
|
+
return this.http.get(routes.VALIDATE, { metric, params, tracing: {
|
|
43
|
+
requestSpanNameSuffix: metric,
|
|
44
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
45
|
+
} });
|
|
46
|
+
};
|
|
47
|
+
this.getPasswordAuthenticationToken = (token, email, password, tracingConfig) => {
|
|
48
|
+
const params = {
|
|
49
|
+
authenticationToken: token,
|
|
50
|
+
login: email,
|
|
51
|
+
password,
|
|
52
|
+
};
|
|
53
|
+
const metric = 'vtexid-pass-token';
|
|
54
|
+
return this.http.get(routes.VALIDATE_CLASSIC, { metric, params, tracing: {
|
|
55
|
+
requestSpanNameSuffix: metric,
|
|
56
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
57
|
+
} });
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.ID = ID;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { InstanceOptions, IOContext, RequestTracingConfig } from '../..';
|
|
2
|
+
import { ExternalClient } from './ExternalClient';
|
|
3
|
+
export declare class MasterData extends ExternalClient {
|
|
4
|
+
constructor(ctx: IOContext, options?: InstanceOptions);
|
|
5
|
+
getSchema<T>({ dataEntity, schema }: GetSchemaInput, tracingConfig?: RequestTracingConfig): Promise<T>;
|
|
6
|
+
createOrUpdateSchema<T>({ dataEntity, schemaName, schemaBody }: CreateSchemaInput, tracingConfig?: RequestTracingConfig): Promise<T>;
|
|
7
|
+
getPublicSchema<T>({ dataEntity, schema }: GetSchemaInput, tracingConfig?: RequestTracingConfig): Promise<T>;
|
|
8
|
+
getDocument<T>({ dataEntity, id, fields }: GetDocumentInput, tracingConfig?: RequestTracingConfig): Promise<T>;
|
|
9
|
+
createDocument({ dataEntity, fields, schema }: CreateDocumentInput, tracingConfig?: RequestTracingConfig): Promise<DocumentResponse>;
|
|
10
|
+
createOrUpdateEntireDocument({ dataEntity, fields, id, schema }: CreateOrUpdateInput, tracingConfig?: RequestTracingConfig): Promise<DocumentResponse>;
|
|
11
|
+
createOrUpdatePartialDocument({ dataEntity, fields, id, schema }: CreateOrUpdateInput, tracingConfig?: RequestTracingConfig): Promise<DocumentResponse>;
|
|
12
|
+
updateEntireDocument({ dataEntity, id, fields, schema }: UpdateInput, tracingConfig?: RequestTracingConfig): Promise<void>;
|
|
13
|
+
updatePartialDocument({ dataEntity, id, fields, schema }: UpdateInput, tracingConfig?: RequestTracingConfig): Promise<void>;
|
|
14
|
+
searchDocuments<T>({ dataEntity, fields, where, pagination, schema, sort }: SearchInput, tracingConfig?: RequestTracingConfig): Promise<T[]>;
|
|
15
|
+
searchDocumentsWithPaginationInfo<T>({ dataEntity, fields, where, pagination, schema, sort }: SearchInput, tracingConfig?: RequestTracingConfig): Promise<{
|
|
16
|
+
data: T[];
|
|
17
|
+
pagination: {
|
|
18
|
+
total: number;
|
|
19
|
+
page: number;
|
|
20
|
+
pageSize: number;
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
scrollDocuments<T>({ dataEntity, fields, where, mdToken, schema, size, sort }: ScrollInput, tracingConfig?: RequestTracingConfig): Promise<{
|
|
24
|
+
mdToken: string;
|
|
25
|
+
data: ScrollResponse<T>;
|
|
26
|
+
}>;
|
|
27
|
+
deleteDocument({ dataEntity, id }: DeleteInput, tracingConfig?: RequestTracingConfig): Promise<import("../..").IOResponse<void>>;
|
|
28
|
+
}
|
|
29
|
+
interface PaginationArgs {
|
|
30
|
+
page: number;
|
|
31
|
+
pageSize: number;
|
|
32
|
+
}
|
|
33
|
+
interface DocumentResponse {
|
|
34
|
+
Id: string;
|
|
35
|
+
Href: string;
|
|
36
|
+
DocumentId: string;
|
|
37
|
+
}
|
|
38
|
+
interface GetSchemaInput {
|
|
39
|
+
dataEntity: string;
|
|
40
|
+
schema: string;
|
|
41
|
+
}
|
|
42
|
+
interface CreateSchemaInput {
|
|
43
|
+
dataEntity: string;
|
|
44
|
+
schemaName: string;
|
|
45
|
+
schemaBody: object;
|
|
46
|
+
}
|
|
47
|
+
interface GetDocumentInput {
|
|
48
|
+
dataEntity: string;
|
|
49
|
+
id: string;
|
|
50
|
+
fields: string[];
|
|
51
|
+
}
|
|
52
|
+
interface CreateDocumentInput {
|
|
53
|
+
dataEntity: string;
|
|
54
|
+
fields: object;
|
|
55
|
+
schema?: string;
|
|
56
|
+
}
|
|
57
|
+
interface CreateOrUpdateInput {
|
|
58
|
+
dataEntity: string;
|
|
59
|
+
fields: object;
|
|
60
|
+
id?: string;
|
|
61
|
+
schema?: string;
|
|
62
|
+
}
|
|
63
|
+
interface UpdateInput {
|
|
64
|
+
dataEntity: string;
|
|
65
|
+
id: string;
|
|
66
|
+
fields: object;
|
|
67
|
+
schema?: string;
|
|
68
|
+
}
|
|
69
|
+
interface SearchInput {
|
|
70
|
+
dataEntity: string;
|
|
71
|
+
fields: string[];
|
|
72
|
+
where?: string;
|
|
73
|
+
pagination: PaginationArgs;
|
|
74
|
+
schema?: string;
|
|
75
|
+
sort?: string;
|
|
76
|
+
}
|
|
77
|
+
interface ScrollInput {
|
|
78
|
+
dataEntity: string;
|
|
79
|
+
fields: string[];
|
|
80
|
+
where?: string;
|
|
81
|
+
schema?: string;
|
|
82
|
+
sort?: string;
|
|
83
|
+
size?: number;
|
|
84
|
+
mdToken?: string;
|
|
85
|
+
}
|
|
86
|
+
interface DeleteInput {
|
|
87
|
+
dataEntity: string;
|
|
88
|
+
id: string;
|
|
89
|
+
}
|
|
90
|
+
interface ScrollResponse<T> {
|
|
91
|
+
data: T[];
|
|
92
|
+
mdToken: string;
|
|
93
|
+
}
|
|
94
|
+
export {};
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterData = void 0;
|
|
4
|
+
const __1 = require("../..");
|
|
5
|
+
const HttpClient_1 = require("../../HttpClient");
|
|
6
|
+
const ExternalClient_1 = require("./ExternalClient");
|
|
7
|
+
const routes = {
|
|
8
|
+
document: (dataEntity, id) => `${dataEntity}/documents/${id}`,
|
|
9
|
+
documents: (dataEntity) => `${dataEntity}/documents`,
|
|
10
|
+
publicSchema: (dataEntity, schema) => `${dataEntity}/schemas/${schema}/public`,
|
|
11
|
+
schema: (dataEntity, schema) => `${dataEntity}/schemas/${schema}`,
|
|
12
|
+
scroll: (dataEntity) => `${dataEntity}/scroll`,
|
|
13
|
+
search: (dataEntity) => `${dataEntity}/search`,
|
|
14
|
+
};
|
|
15
|
+
class MasterData extends ExternalClient_1.ExternalClient {
|
|
16
|
+
constructor(ctx, options) {
|
|
17
|
+
super(`http://api.vtex.com/api/dataentities`, ctx, {
|
|
18
|
+
...options,
|
|
19
|
+
headers: {
|
|
20
|
+
Accept: 'application/json',
|
|
21
|
+
VtexIdclientAutCookie: ctx.authToken,
|
|
22
|
+
'x-vtex-api-appService': ctx.userAgent,
|
|
23
|
+
...options === null || options === void 0 ? void 0 : options.headers,
|
|
24
|
+
},
|
|
25
|
+
params: {
|
|
26
|
+
an: ctx.account,
|
|
27
|
+
...options === null || options === void 0 ? void 0 : options.params,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getSchema({ dataEntity, schema }, tracingConfig) {
|
|
32
|
+
const metric = 'masterdata-getSchema';
|
|
33
|
+
return this.http.get(routes.schema(dataEntity, schema), {
|
|
34
|
+
metric,
|
|
35
|
+
tracing: {
|
|
36
|
+
requestSpanNameSuffix: metric,
|
|
37
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
createOrUpdateSchema({ dataEntity, schemaName, schemaBody }, tracingConfig) {
|
|
42
|
+
const metric = 'masterdata-createOrUpdateSchema';
|
|
43
|
+
return this.http.put(routes.schema(dataEntity, schemaName), schemaBody, {
|
|
44
|
+
metric,
|
|
45
|
+
tracing: {
|
|
46
|
+
requestSpanNameSuffix: metric,
|
|
47
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
getPublicSchema({ dataEntity, schema }, tracingConfig) {
|
|
52
|
+
const metric = 'masterdata-getPublicSchema';
|
|
53
|
+
return this.http.get(routes.publicSchema(dataEntity, schema), {
|
|
54
|
+
metric,
|
|
55
|
+
tracing: {
|
|
56
|
+
requestSpanNameSuffix: metric,
|
|
57
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
getDocument({ dataEntity, id, fields }, tracingConfig) {
|
|
62
|
+
const metric = 'masterdata-getDocument';
|
|
63
|
+
return this.http.get(routes.document(dataEntity, id), {
|
|
64
|
+
metric,
|
|
65
|
+
params: {
|
|
66
|
+
_fields: generateFieldsArg(fields),
|
|
67
|
+
},
|
|
68
|
+
tracing: {
|
|
69
|
+
requestSpanNameSuffix: metric,
|
|
70
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
createDocument({ dataEntity, fields, schema }, tracingConfig) {
|
|
75
|
+
const metric = 'masterdata-createDocument';
|
|
76
|
+
return this.http.post(routes.documents(dataEntity), fields, {
|
|
77
|
+
metric,
|
|
78
|
+
params: {
|
|
79
|
+
_schema: schema,
|
|
80
|
+
},
|
|
81
|
+
tracing: {
|
|
82
|
+
requestSpanNameSuffix: metric,
|
|
83
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
createOrUpdateEntireDocument({ dataEntity, fields, id, schema }, tracingConfig) {
|
|
88
|
+
const metric = 'masterdata-createOrUpdateEntireDocument';
|
|
89
|
+
return this.http.put(routes.documents(dataEntity), { id, ...fields }, {
|
|
90
|
+
metric,
|
|
91
|
+
params: {
|
|
92
|
+
_schema: schema,
|
|
93
|
+
},
|
|
94
|
+
tracing: {
|
|
95
|
+
requestSpanNameSuffix: metric,
|
|
96
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
createOrUpdatePartialDocument({ dataEntity, fields, id, schema }, tracingConfig) {
|
|
101
|
+
const metric = 'masterdata-createOrUpdatePartialDocument';
|
|
102
|
+
return this.http.patch(routes.documents(dataEntity), { id, ...fields }, {
|
|
103
|
+
metric,
|
|
104
|
+
params: {
|
|
105
|
+
_schema: schema,
|
|
106
|
+
},
|
|
107
|
+
tracing: {
|
|
108
|
+
requestSpanNameSuffix: metric,
|
|
109
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
updateEntireDocument({ dataEntity, id, fields, schema }, tracingConfig) {
|
|
114
|
+
const metric = 'masterdata-updateEntireDocument';
|
|
115
|
+
return this.http.put(routes.document(dataEntity, id), fields, {
|
|
116
|
+
metric,
|
|
117
|
+
params: {
|
|
118
|
+
_schema: schema,
|
|
119
|
+
},
|
|
120
|
+
tracing: {
|
|
121
|
+
requestSpanNameSuffix: metric,
|
|
122
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
updatePartialDocument({ dataEntity, id, fields, schema }, tracingConfig) {
|
|
127
|
+
const metric = 'masterdata-updatePartialDocument';
|
|
128
|
+
return this.http.patch(routes.document(dataEntity, id), fields, {
|
|
129
|
+
metric,
|
|
130
|
+
params: {
|
|
131
|
+
_schema: schema,
|
|
132
|
+
},
|
|
133
|
+
tracing: {
|
|
134
|
+
requestSpanNameSuffix: metric,
|
|
135
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
136
|
+
},
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
searchDocuments({ dataEntity, fields, where, pagination, schema, sort }, tracingConfig) {
|
|
140
|
+
const metric = 'masterdata-searchDocuments';
|
|
141
|
+
return this.http.get(routes.search(dataEntity), {
|
|
142
|
+
cacheable: HttpClient_1.CacheType.None,
|
|
143
|
+
headers: paginationArgsToHeaders(pagination),
|
|
144
|
+
metric,
|
|
145
|
+
params: {
|
|
146
|
+
_fields: generateFieldsArg(fields),
|
|
147
|
+
_schema: schema,
|
|
148
|
+
_sort: sort,
|
|
149
|
+
_where: where,
|
|
150
|
+
},
|
|
151
|
+
tracing: {
|
|
152
|
+
requestSpanNameSuffix: metric,
|
|
153
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
async searchDocumentsWithPaginationInfo({ dataEntity, fields, where, pagination, schema, sort }, tracingConfig) {
|
|
158
|
+
const metric = 'masterdata-searchDocumentsWithPagination';
|
|
159
|
+
const result = await this.http.getRaw(routes.search(dataEntity), {
|
|
160
|
+
cacheable: HttpClient_1.CacheType.None,
|
|
161
|
+
headers: paginationArgsToHeaders(pagination),
|
|
162
|
+
metric,
|
|
163
|
+
params: {
|
|
164
|
+
_fields: generateFieldsArg(fields),
|
|
165
|
+
_schema: schema,
|
|
166
|
+
_sort: sort,
|
|
167
|
+
_where: where,
|
|
168
|
+
},
|
|
169
|
+
tracing: {
|
|
170
|
+
requestSpanNameSuffix: metric,
|
|
171
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
const headers = result.headers;
|
|
175
|
+
const restContentRange = headers['rest-content-range'];
|
|
176
|
+
const total = Number(restContentRange.split('/')[1]);
|
|
177
|
+
const paginationInfo = { ...pagination, total };
|
|
178
|
+
return { data: result.data, pagination: paginationInfo };
|
|
179
|
+
}
|
|
180
|
+
scrollDocuments({ dataEntity, fields, where, mdToken, schema, size, sort }, tracingConfig) {
|
|
181
|
+
const metric = 'masterdata-scrollDocuments';
|
|
182
|
+
return this.http
|
|
183
|
+
.getRaw(routes.scroll(dataEntity), {
|
|
184
|
+
cacheable: HttpClient_1.CacheType.None,
|
|
185
|
+
metric,
|
|
186
|
+
params: {
|
|
187
|
+
_fields: generateFieldsArg(fields),
|
|
188
|
+
_schema: schema,
|
|
189
|
+
_size: size,
|
|
190
|
+
_sort: sort,
|
|
191
|
+
_token: mdToken,
|
|
192
|
+
_where: where,
|
|
193
|
+
},
|
|
194
|
+
tracing: {
|
|
195
|
+
requestSpanNameSuffix: metric,
|
|
196
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
197
|
+
},
|
|
198
|
+
})
|
|
199
|
+
.then(({ headers: { 'x-vtex-md-token': resToken }, data }) => ({ mdToken: resToken, data }));
|
|
200
|
+
}
|
|
201
|
+
deleteDocument({ dataEntity, id }, tracingConfig) {
|
|
202
|
+
const metric = 'masterdata-deleteDocument';
|
|
203
|
+
return this.http.delete(routes.document(dataEntity, id), {
|
|
204
|
+
metric,
|
|
205
|
+
tracing: {
|
|
206
|
+
requestSpanNameSuffix: metric,
|
|
207
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
exports.MasterData = MasterData;
|
|
213
|
+
function paginationArgsToHeaders({ page, pageSize }) {
|
|
214
|
+
if (page < 1) {
|
|
215
|
+
throw new __1.UserInputError('Smallest page value is 1');
|
|
216
|
+
}
|
|
217
|
+
const startIndex = (page - 1) * pageSize;
|
|
218
|
+
const endIndex = startIndex + pageSize;
|
|
219
|
+
return {
|
|
220
|
+
'REST-Range': `resources=${startIndex}-${endIndex}`,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function generateFieldsArg(fields) {
|
|
224
|
+
return fields.join(',');
|
|
225
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { InstanceOptions, IOContext, Maybe } from '../..';
|
|
2
|
+
import { RequestTracingConfig } from '../../HttpClient';
|
|
3
|
+
import { ExternalClient } from './ExternalClient';
|
|
4
|
+
export declare class PaymentProvider extends ExternalClient {
|
|
5
|
+
protected context: IOContext;
|
|
6
|
+
constructor(context: IOContext, options?: InstanceOptions);
|
|
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
|
+
}
|
|
10
|
+
export interface AuthorizationCallback {
|
|
11
|
+
paymentId: string;
|
|
12
|
+
status: string;
|
|
13
|
+
tid: string;
|
|
14
|
+
authorizationId?: Maybe<string>;
|
|
15
|
+
nsu?: Maybe<string>;
|
|
16
|
+
acquirer: string;
|
|
17
|
+
paymentUrl?: Maybe<string>;
|
|
18
|
+
paymentAppData?: Maybe<{
|
|
19
|
+
appName: string;
|
|
20
|
+
payload: string;
|
|
21
|
+
}>;
|
|
22
|
+
identificationNumber?: Maybe<string>;
|
|
23
|
+
identificationNumberFormatted?: Maybe<string>;
|
|
24
|
+
barCodeImageType?: Maybe<string>;
|
|
25
|
+
barCodeImageNumber?: Maybe<string>;
|
|
26
|
+
code?: Maybe<string>;
|
|
27
|
+
message?: Maybe<string>;
|
|
28
|
+
delayToAutoSettle?: Maybe<number>;
|
|
29
|
+
delayToAutoSettleAfterAntifraud?: Maybe<number>;
|
|
30
|
+
delayToCancel?: Maybe<number>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PaymentProvider = void 0;
|
|
4
|
+
const ExternalClient_1 = require("./ExternalClient");
|
|
5
|
+
const routes = {
|
|
6
|
+
callback: (transactionId, paymentId) => `${routes.payment(transactionId, paymentId)}/notification`,
|
|
7
|
+
inbound: (transactionId, paymentId, action) => `${routes.payment(transactionId, paymentId)}/inbound-request/${action}`,
|
|
8
|
+
payment: (transactionId, paymentId) => `/transactions/${transactionId}/payments/${paymentId}`,
|
|
9
|
+
};
|
|
10
|
+
class PaymentProvider extends ExternalClient_1.ExternalClient {
|
|
11
|
+
constructor(context, options) {
|
|
12
|
+
var _a;
|
|
13
|
+
super(`http://${context.account}.vtexpayments.com.br/payment-provider`, context, {
|
|
14
|
+
...(options !== null && options !== void 0 ? options : {}),
|
|
15
|
+
headers: {
|
|
16
|
+
...((_a = options === null || options === void 0 ? void 0 : options.headers) !== null && _a !== void 0 ? _a : {}),
|
|
17
|
+
'X-Vtex-Use-Https': 'true',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
this.context = context;
|
|
21
|
+
this.callback = (transactionId, paymentId, callback, tracingConfig) => {
|
|
22
|
+
const metric = 'gateway-callback';
|
|
23
|
+
return this.http.post(routes.callback(transactionId, paymentId), callback, {
|
|
24
|
+
metric,
|
|
25
|
+
tracing: {
|
|
26
|
+
requestSpanNameSuffix: metric,
|
|
27
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
this.inbound = (transactionId, paymentId, action, payload, tracingConfig) => {
|
|
32
|
+
const metric = 'gateway-inbound-request';
|
|
33
|
+
return this.http.post(routes.inbound(transactionId, paymentId, action), payload, {
|
|
34
|
+
metric,
|
|
35
|
+
tracing: {
|
|
36
|
+
requestSpanNameSuffix: metric,
|
|
37
|
+
...tracingConfig === null || tracingConfig === void 0 ? void 0 : tracingConfig.tracing,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.PaymentProvider = PaymentProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = 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);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ExternalClient"), exports);
|
|
18
|
+
__exportStar(require("./ID"), exports);
|
|
19
|
+
__exportStar(require("./PaymentProvider"), exports);
|
|
20
|
+
__exportStar(require("./Masterdata"), exports);
|
package/lib/clients/index.d.ts
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export * from './Logger';
|
|
11
|
-
export * from './Messages';
|
|
12
|
-
export * from './MessagesGraphQL';
|
|
13
|
-
export * from './Metadata';
|
|
14
|
-
export * from './Registry';
|
|
15
|
-
export * from './Router';
|
|
16
|
-
export * from './Segment';
|
|
17
|
-
export * from './Settings';
|
|
18
|
-
export * from './Session';
|
|
19
|
-
export * from './Sphinx';
|
|
20
|
-
export * from './VBase';
|
|
21
|
-
export * from './Workspaces';
|
|
1
|
+
export * from './apps';
|
|
2
|
+
export * from './external';
|
|
3
|
+
export * from './infra';
|
|
4
|
+
export * from './janus';
|
|
5
|
+
export * from './IOClient';
|
|
6
|
+
export * from './IOClients';
|
|
7
|
+
export * from './IOGraphQLClient';
|
|
8
|
+
import promclient from 'prom-client';
|
|
9
|
+
export { promclient };
|
package/lib/clients/index.js
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = 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);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
5
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
__export(require("./Messages"));
|
|
17
|
-
__export(require("./MessagesGraphQL"));
|
|
18
|
-
__export(require("./Metadata"));
|
|
19
|
-
__export(require("./Registry"));
|
|
20
|
-
__export(require("./Router"));
|
|
21
|
-
__export(require("./Segment"));
|
|
22
|
-
__export(require("./Settings"));
|
|
23
|
-
__export(require("./Session"));
|
|
24
|
-
__export(require("./Sphinx"));
|
|
25
|
-
__export(require("./VBase"));
|
|
26
|
-
__export(require("./Workspaces"));
|
|
20
|
+
exports.promclient = void 0;
|
|
21
|
+
__exportStar(require("./apps"), exports);
|
|
22
|
+
__exportStar(require("./external"), exports);
|
|
23
|
+
__exportStar(require("./infra"), exports);
|
|
24
|
+
__exportStar(require("./janus"), exports);
|
|
25
|
+
__exportStar(require("./IOClient"), exports);
|
|
26
|
+
__exportStar(require("./IOClients"), exports);
|
|
27
|
+
__exportStar(require("./IOGraphQLClient"), exports);
|
|
28
|
+
const prom_client_1 = __importDefault(require("prom-client"));
|
|
29
|
+
exports.promclient = prom_client_1.default;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
import { IncomingMessage } from 'http';
|
|
6
|
+
import { Readable, Writable } from 'stream';
|
|
7
|
+
import { ZlibOptions } from 'zlib';
|
|
8
|
+
import { InstanceOptions, RequestTracingConfig } from '../../HttpClient';
|
|
9
|
+
import { AppFilesList, AppManifest } from '../../responses';
|
|
10
|
+
import { IOContext } from '../../service/worker/runtime/typings';
|
|
11
|
+
import { InfraClient } from './InfraClient';
|
|
12
|
+
export declare class Apps extends InfraClient {
|
|
13
|
+
private _routes;
|
|
14
|
+
private diskCache;
|
|
15
|
+
private memoryCache;
|
|
16
|
+
private get routes();
|
|
17
|
+
constructor(context: IOContext, options?: InstanceOptions);
|
|
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<{
|
|
32
|
+
data: Buffer;
|
|
33
|
+
headers: any;
|
|
34
|
+
}>;
|
|
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[]>>;
|
|
49
|
+
private installRuntime;
|
|
50
|
+
}
|
|
51
|
+
interface ZipOptions {
|
|
52
|
+
zlib?: ZlibOptions;
|
|
53
|
+
}
|
|
54
|
+
export interface AppMetaInfo {
|
|
55
|
+
id: string;
|
|
56
|
+
settingsSchema?: Record<string, any>;
|
|
57
|
+
_resolvedDependencies: Record<string, string>;
|
|
58
|
+
_isRoot: boolean;
|
|
59
|
+
_buildFeatures: Record<string, string[]>;
|
|
60
|
+
}
|
|
61
|
+
export interface WorkspaceMetaInfo {
|
|
62
|
+
apps: AppMetaInfo[];
|
|
63
|
+
}
|
|
64
|
+
export interface AppsListItem {
|
|
65
|
+
app: string;
|
|
66
|
+
id: string;
|
|
67
|
+
location: string;
|
|
68
|
+
}
|
|
69
|
+
export interface AppsList {
|
|
70
|
+
data: AppsListItem[];
|
|
71
|
+
}
|
|
72
|
+
export interface Change {
|
|
73
|
+
path: string;
|
|
74
|
+
content: string | Readable | Buffer;
|
|
75
|
+
}
|
|
76
|
+
export interface ListAppsOptions {
|
|
77
|
+
oldVersion?: string;
|
|
78
|
+
context?: string[];
|
|
79
|
+
since?: string;
|
|
80
|
+
service?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface ListFilesOptions {
|
|
83
|
+
prefix?: string;
|
|
84
|
+
context?: string[];
|
|
85
|
+
nextMarker?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface AppsSettings {
|
|
88
|
+
[app: string]: any;
|
|
89
|
+
}
|
|
90
|
+
export interface AppInstallResponse {
|
|
91
|
+
message: string;
|
|
92
|
+
}
|
|
93
|
+
export {};
|