UNPKG

@shipengine/connect-order-source-api

Version:

This is the typescript/javascript definitions for the order source api

42 lines 2.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AuthSpecificationSchema = exports.AuthSpecification = void 0; const tslib_1 = require("tslib"); const auth_identifier_1 = require("./auth-identifier"); const monoauth_1 = require("./monoauth"); const joi_1 = tslib_1.__importDefault(require("joi")); /** @description Used to specify information about an integrations authentication */ class AuthSpecification { /** @description Identify the type of Auth being used by the integration */ Identifier; /** @description Added to allow oauth 1.0 to work. */ access_token; /** @description Authorization: the beginning of an OAuth2.0 flow that ensures the user is logged * in and approves access to the Resource. */ authorization; /** @description Request Token: server-server code for token exchange */ request_token; /** @description Refresh Token: server-server refresh token exchange for access token * **NOTE: sometimes a new RT is also created** */ refresh_token; /** @description Advanced configurations used for oauth 1.0 */ advanced_configuration; /** @description Connections is an optional feature that an integration may provide. A common use * of connections is to provide the ability to connect to a sandbox or production endpoint. * Connection name values may be accessed in a flow e.g in the request_token section, the url is * dynamic. * * "url_template": "{connection_name:$.url}/access/token/request", */ connections; } exports.AuthSpecification = AuthSpecification; exports.AuthSpecificationSchema = joi_1.default.object({ Identifier: auth_identifier_1.AuthIdentifierSchema, access_token: monoauth_1.AccessTokenSchema.optional(), authorization: monoauth_1.AuthorizationConfigurationSchema.optional(), request_token: monoauth_1.RequestTokenConfigurationSchema.optional(), refresh_token: monoauth_1.RefreshTokenConfigurationSchema.optional(), advanced_configuration: joi_1.default.array().optional().items(monoauth_1.ParameterSchema), connections: monoauth_1.ConnectionNamesConfigurationSchema.optional(), }); //# sourceMappingURL=auth-specification.js.map