UNPKG

@shipengine/connect-fulfillment-provider-api

Version:

OpenAPI specification and TypeScript definitions for the Connect Fulfillment Provider API

142 lines 7.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConnectionNamesConfiguration = exports.RefreshTokenConfiguration = exports.DateTimeConfiguration = exports.ResponseTransformationConfiguration = exports.RequestTokenConfiguration = exports.NonceConfiguration = exports.Parameter = exports.AuthorizationConfiguration = exports.AccessToken = exports.AuthenticationType = exports.AuthIdentifier = exports.AuthSpecification = void 0; /** @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; class AuthIdentifier { AuthenticationType; Version; IsSandbox; } exports.AuthIdentifier = AuthIdentifier; var AuthenticationType; (function (AuthenticationType) { AuthenticationType["OAuth"] = "oauth"; AuthenticationType["Basic"] = "basic"; AuthenticationType["ApiKey"] = "apikey"; })(AuthenticationType || (exports.AuthenticationType = AuthenticationType = {})); class AccessToken { /** @description OAuth1 only. The url to obtain the temporary Access (aka Request) Token to start a flow **/ url_template; } exports.AccessToken = AccessToken; class AuthorizationConfiguration { /** @description The url to obtain the access token using the authorization code on the backend * @example "http://{auth_state:store_name}.store.com/admin/oauth/authorize", "http://store.com/oauth/authorize" */ url_template; /** @description A list of query parameters that will be attached to the url */ query_parameters; /** @description Method to use when making the server-server code for token request @example "GET", "POST" */ method; /** @description List of parameters that are sent to the integration during the server-server * authorization request. These are built using the content type specified in the headers array. */ body; /** @description List of headers that are sent to the integration when authorizing a token */ headers; /** @description A nonce query parameter included on the accept request, then returned and validated on the redirect request */ nonce; } exports.AuthorizationConfiguration = AuthorizationConfiguration; class Parameter { /** @description The name of the parameter */ name; /** @description The value associated with the parameter */ value; } exports.Parameter = Parameter; class NonceConfiguration { name; } exports.NonceConfiguration = NonceConfiguration; class RequestTokenConfiguration { /** @description The url to obtain the access token using the authorization code on the backend @example "http://{auth_state:store_name}.store.com/admin/oauth/request", "http://store.com/oauth/request" */ url_template; /** @description A list of query parameters that will be attached to the url */ query_parameters; /** @description Method to use when making the server-server code for token request @example "GET", "POST" */ method; /** @description List of parameters that are sent to the integration when exchanging the code for the token. These are built using ContentType */ body; /** @description List of headers that are sent to the integration when requesting a token */ headers; /** @description Response payload parsing */ response; } exports.RequestTokenConfiguration = RequestTokenConfiguration; class ResponseTransformationConfiguration { /** @description JSONPath to the JSON element for access_token. */ access_token; /** @description JSONPath to the JSON element for token_type */ token_type; /** @description JSONPath to the JSON element for refresh_token */ refresh_token; /** @description JSONPath to the JSON element for expires_in. Mutually exclusive with expires_at */ expires_in; /** @description Configuration for parsing a date-time, when the integration is lacking expires_in. * Mutually exclusive with expires_in. */ expires_at; /** @description Optional collection of properties to include in the connection_context sent back with the auth flow result. * Property value may be JSONPath or a string literal. * E.g. * "connection_context": { * "store_id": "$.data.store_id" * } */ connection_context; } exports.ResponseTransformationConfiguration = ResponseTransformationConfiguration; class DateTimeConfiguration { /** @description JSONPath to the JSON element containing the date-time */ path; /** @description DateTime format string compliant with * https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings */ date_time_format; } exports.DateTimeConfiguration = DateTimeConfiguration; class RefreshTokenConfiguration { /** @description The url to refresh the access token using the authorization code on the backend @example "http://{auth_state:store_name}.store.com/admin/oauth/refresh", "http://store.com/oauth/refresh" */ url_template; /** @description A list of query parameters that will be attached to the url */ query_parameters; /** @description Method to use when making the server-server code for token request @example "GET", "POST" */ method; /** @description List of parameters that are sent to the integration during the server-server refresh token request. These are built using the content type specified in the headers array. */ body; /** @description List of headers that are sent to the integration when refreshing a token */ headers; /** @description Response payload parsing */ response; } exports.RefreshTokenConfiguration = RefreshTokenConfiguration; class ConnectionNamesConfiguration { /** @description A unique list of connection names that the integration supports. */ connection_names; /** @description The connection name that will be used when none is selected. */ default_connection_name; } exports.ConnectionNamesConfiguration = ConnectionNamesConfiguration; //# sourceMappingURL=fulfillment-provider-app-metadata.js.map