@shipengine/connect-carrier-api 2.1.22 → 2.1.23
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/lib/app/internal/{carrier-app-specificaion.d.ts → carrier-app-specification.d.ts} +4 -1
- package/lib/app/internal/{carrier-app-specificaion.js → carrier-app-specification.js} +1 -1
- package/lib/app/internal/carrier-app-specification.js.map +1 -0
- package/lib/app/internal/{carrier-specificaion.d.ts → carrier-specification.d.ts} +0 -0
- package/lib/app/internal/{carrier-specificaion.js → carrier-specification.js} +1 -1
- package/lib/app/internal/carrier-specification.js.map +1 -0
- package/lib/app/internal/metadata.d.ts +4 -2
- package/lib/app/internal/metadata.js +6 -2
- package/lib/app/internal/metadata.js.map +1 -1
- package/lib/app/metadata/auth-identifier.d.ts +10 -0
- package/lib/app/metadata/auth-identifier.js +18 -0
- package/lib/app/metadata/auth-identifier.js.map +1 -0
- package/lib/app/metadata/auth-specification.d.ts +19 -0
- package/lib/app/metadata/auth-specification.js +20 -0
- package/lib/app/metadata/auth-specification.js.map +1 -0
- package/lib/app/metadata/carrier-app-metadata.d.ts +3 -1
- package/lib/app/metadata/carrier-app-metadata.js +3 -2
- package/lib/app/metadata/carrier-app-metadata.js.map +1 -1
- package/lib/app/metadata/index.d.ts +4 -1
- package/lib/app/metadata/index.js +4 -1
- package/lib/app/metadata/index.js.map +1 -1
- package/lib/app/metadata/monoauth.d.ts +102 -0
- package/lib/app/metadata/monoauth.js +82 -0
- package/lib/app/metadata/monoauth.js.map +1 -0
- package/package.json +1 -1
- package/src/app/carrier-app.ts +1 -1
- package/src/app/internal/{carrier-app-specificaion.ts → carrier-app-specification.ts} +4 -1
- package/src/app/internal/{carrier-specificaion.ts → carrier-specification.ts} +0 -0
- package/src/app/internal/metadata.ts +8 -2
- package/src/app/metadata/auth-identifier.ts +17 -0
- package/src/app/metadata/auth-specification.ts +39 -0
- package/src/app/metadata/carrier-app-metadata.ts +9 -1
- package/src/app/metadata/index.ts +4 -1
- package/src/app/metadata/monoauth.ts +171 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/app/internal/carrier-app-specificaion.js.map +0 -1
- package/lib/app/internal/carrier-specificaion.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { AuthSpecification } from '../metadata/auth-specification';
|
|
1
2
|
import { ShippingProviderConnector } from '../metadata/shipping-provider-connector';
|
|
2
|
-
import { CarrierSpecification } from './carrier-
|
|
3
|
+
import { CarrierSpecification } from './carrier-specification';
|
|
3
4
|
/** @description This represents a single integration which may contain multiple carrier sources */
|
|
4
5
|
export interface CarrierAppSpecification {
|
|
5
6
|
/** @description The id for this integration */
|
|
@@ -8,6 +9,8 @@ export interface CarrierAppSpecification {
|
|
|
8
9
|
Name: string;
|
|
9
10
|
/** @description Information about the connector */
|
|
10
11
|
Connector: ShippingProviderConnector;
|
|
12
|
+
/** @description The specification for authorizing with this carrier */
|
|
13
|
+
AuthProcess?: AuthSpecification;
|
|
11
14
|
/** @description A list of carrier sources associated with this integration */
|
|
12
15
|
Carriers: CarrierSpecification[];
|
|
13
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carrier-app-specification.js","sourceRoot":"","sources":["../../../src/app/internal/carrier-app-specification.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carrier-specification.js","sourceRoot":"","sources":["../../../src/app/internal/carrier-specification.ts"],"names":[],"mappings":";;;AAoBO,MAAM,kBAAkB,GAAG,CAChC,OAAkC,EACJ,EAAE;IAChC,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,SAAS,CAAC;KAClB;IACD,MAAM,GAAG,GAAqB,EAAE,CAAC;IACjC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE;QAC3C,MAAM,IAAI,GAAG,GAAyB,CAAC;QACvC,MAAM,EAAE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AC;QACpD,IAAI,CAAC,eAAe,GAAG,0BAAkB,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;QACtE,IAAI,CAAC,yBAAyB,GAAG,UAAU,CAAC,yBAAyB,CAAC;QACtE,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC;QACtD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,wBAAwB,GAAG,4BAAoB,CAClD,UAAU,CAAC,wBAAwB,CACpC,CAAC;QACF,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,CAAC;QACtD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;IAC5C,CAAC;CACF;AA1CD,oDA0CC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { CarrierAppDefinition } from '../carrier-app-definition';
|
|
2
2
|
import { ShippingProviderConnector } from '../metadata/shipping-provider-connector';
|
|
3
|
-
import { CarrierAppSpecification } from './carrier-app-
|
|
4
|
-
import { CarrierSpecification } from './carrier-
|
|
3
|
+
import { CarrierAppSpecification } from './carrier-app-specification';
|
|
4
|
+
import { CarrierSpecification } from './carrier-specification';
|
|
5
|
+
import { AuthSpecification } from '../metadata/auth-specification';
|
|
5
6
|
export declare class Metadata implements CarrierAppSpecification {
|
|
6
7
|
Id: string;
|
|
7
8
|
Name: string;
|
|
8
9
|
Connector: ShippingProviderConnector;
|
|
10
|
+
AuthProcess?: AuthSpecification;
|
|
9
11
|
Carriers: CarrierSpecification[];
|
|
10
12
|
constructor(app: CarrierAppDefinition);
|
|
11
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Metadata = void 0;
|
|
4
|
-
const
|
|
4
|
+
const carrier_specification_1 = require("./carrier-specification");
|
|
5
5
|
const fn = (name) => ({
|
|
6
6
|
Name: name,
|
|
7
7
|
IsSandboxed: false,
|
|
@@ -38,7 +38,11 @@ class Metadata {
|
|
|
38
38
|
constructor(app) {
|
|
39
39
|
this.Id = app.Metadata.Id;
|
|
40
40
|
this.Name = app.Metadata.Name;
|
|
41
|
-
this.
|
|
41
|
+
this.AuthProcess = app.Metadata.AuthProcess;
|
|
42
|
+
if (this.AuthProcess) {
|
|
43
|
+
this.AuthProcess.Identifier.Version = '2.0';
|
|
44
|
+
}
|
|
45
|
+
this.Carriers = app.Metadata.Carriers.map((c) => new carrier_specification_1.CarrierSpecification(c));
|
|
42
46
|
this.Connector = {
|
|
43
47
|
DiagnosticRoutes: {
|
|
44
48
|
Liveness: '/diagnostics/liveness',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../src/app/internal/metadata.ts"],"names":[],"mappings":";;;AAKA,
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../../src/app/internal/metadata.ts"],"names":[],"mappings":";;;AAKA,mEAA+D;AAG/D,MAAM,EAAE,GAAG,CAAC,IAAY,EAAyB,EAAE,CAAC,CAAC;IACnD,IAAI,EAAE,IAAI;IACV,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,CAAC,GAAyB,EAA2B,EAAE;IAC1E,MAAM,GAAG,GAA4B,EAAE,CAAC;IAExC,IAAI,GAAG,CAAC,QAAQ,EAAE;QAChB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;KAC1B;IAED,IAAI,GAAG,CAAC,WAAW,EAAE;QACnB,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;KAC7B;IAED,IAAI,GAAG,CAAC,UAAU,EAAE;QAClB,GAAG,CAAC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C,SAAS,EAAE,wBAAwB;gBACnC,OAAO,EAAE,sBAAsB;aAChC;YACD,UAAU,EAAE,OAAO;YACnB,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC;SAC7B,CAAC;IACJ,CAAC;CACF;AA5BD,4BA4BC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
export declare enum AuthenticationType {
|
|
3
|
+
OAuth = "oauth"
|
|
4
|
+
}
|
|
5
|
+
export declare class AuthIdentifier {
|
|
6
|
+
AuthenticationType: AuthenticationType;
|
|
7
|
+
Version?: string;
|
|
8
|
+
IsSandbox?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const AuthIdentifierSchema: Joi.ObjectSchema<any>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthIdentifierSchema = exports.AuthIdentifier = exports.AuthenticationType = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
6
|
+
var AuthenticationType;
|
|
7
|
+
(function (AuthenticationType) {
|
|
8
|
+
AuthenticationType["OAuth"] = "oauth";
|
|
9
|
+
})(AuthenticationType = exports.AuthenticationType || (exports.AuthenticationType = {}));
|
|
10
|
+
class AuthIdentifier {
|
|
11
|
+
}
|
|
12
|
+
exports.AuthIdentifier = AuthIdentifier;
|
|
13
|
+
exports.AuthIdentifierSchema = joi_1.default.object({
|
|
14
|
+
AuthenticationType: joi_1.default.string().required().valid('oauth'),
|
|
15
|
+
Version: joi_1.default.string().optional(),
|
|
16
|
+
IsSandbox: joi_1.default.bool().optional(),
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=auth-identifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-identifier.js","sourceRoot":"","sources":["../../../src/app/metadata/auth-identifier.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AAEtB,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;AACjB,CAAC,EAFW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAE7B;AAED,MAAa,cAAc;CAI1B;AAJD,wCAIC;AAEY,QAAA,oBAAoB,GAAG,aAAG,CAAC,MAAM,CAAC;IAC7C,kBAAkB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;IAC1D,OAAO,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,aAAG,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AuthIdentifier } from './auth-identifier';
|
|
2
|
+
import { AccessToken, AuthorizationConfiguration, Parameter, RefreshTokenConfiguration, RequestTokenConfiguration } from './monoauth';
|
|
3
|
+
import Joi from 'joi';
|
|
4
|
+
/** @description Used to specify information about an integrations authentication */
|
|
5
|
+
export declare class AuthSpecification {
|
|
6
|
+
/** @description Identify the type of Auth being used by the integration */
|
|
7
|
+
Identifier: AuthIdentifier;
|
|
8
|
+
/** @description Added to allow oauth 1.0 to work. */
|
|
9
|
+
access_token?: AccessToken;
|
|
10
|
+
/** @description Authorization: the beginning of an OAuth2.0 flow that ensures the user is logged in and approves access to the Resource. */
|
|
11
|
+
authorization?: AuthorizationConfiguration;
|
|
12
|
+
/** @description Request Token: server-server code for token exchange */
|
|
13
|
+
request_token?: RequestTokenConfiguration;
|
|
14
|
+
/** @description Refresh Token: server-server refresh token exchange for access token **NOTE: sometimes a new RT is also created** */
|
|
15
|
+
refresh_token?: RefreshTokenConfiguration;
|
|
16
|
+
/** @description Advanced configurations used for oauth 1.0 */
|
|
17
|
+
advanced_configuration?: Parameter[];
|
|
18
|
+
}
|
|
19
|
+
export declare const AuthSpecificationSchema: Joi.ObjectSchema<any>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthSpecificationSchema = exports.AuthSpecification = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const auth_identifier_1 = require("./auth-identifier");
|
|
6
|
+
const monoauth_1 = require("./monoauth");
|
|
7
|
+
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
8
|
+
/** @description Used to specify information about an integrations authentication */
|
|
9
|
+
class AuthSpecification {
|
|
10
|
+
}
|
|
11
|
+
exports.AuthSpecification = AuthSpecification;
|
|
12
|
+
exports.AuthSpecificationSchema = joi_1.default.object({
|
|
13
|
+
Identifier: auth_identifier_1.AuthIdentifierSchema,
|
|
14
|
+
access_token: monoauth_1.AccessTokenSchema.optional(),
|
|
15
|
+
authorization: monoauth_1.AuthorizationConfigurationSchema.optional(),
|
|
16
|
+
request_token: monoauth_1.RequestTokenConfigurationSchema.optional(),
|
|
17
|
+
refresh_token: monoauth_1.RefreshTokenConfigurationSchema.optional(),
|
|
18
|
+
advanced_configuration: joi_1.default.array().optional().items(monoauth_1.ParameterSchema),
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=auth-specification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-specification.js","sourceRoot":"","sources":["../../../src/app/metadata/auth-specification.ts"],"names":[],"mappings":";;;;AAAA,uDAAyE;AACzE,yCAWoB;AACpB,sDAAsB;AAEtB,oFAAoF;AACpF,MAAa,iBAAiB;CAa7B;AAbD,8CAaC;AAEY,QAAA,uBAAuB,GAAG,aAAG,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,sCAAoB;IAChC,YAAY,EAAE,4BAAiB,CAAC,QAAQ,EAAE;IAC1C,aAAa,EAAE,2CAAgC,CAAC,QAAQ,EAAE;IAC1D,aAAa,EAAE,0CAA+B,CAAC,QAAQ,EAAE;IACzD,aAAa,EAAE,0CAA+B,CAAC,QAAQ,EAAE;IACzD,sBAAsB,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,0BAAe,CAAC;CACtE,CAAC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
-
import { Carrier } from '
|
|
2
|
+
import { AuthSpecification, Carrier } from '.';
|
|
3
3
|
export interface CarrierAppMetadata {
|
|
4
4
|
/** @description Id of the carrier app */
|
|
5
5
|
Id: string;
|
|
6
6
|
/** @description Name of the carrier */
|
|
7
7
|
Name: string;
|
|
8
|
+
/** @description The specification for authorizing with this order source */
|
|
9
|
+
AuthProcess?: AuthSpecification;
|
|
8
10
|
/** @description List of carriers for the app */
|
|
9
11
|
Carriers: Carrier[];
|
|
10
12
|
}
|
|
@@ -3,17 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CarrierAppMetadataSchema = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
6
|
-
const
|
|
6
|
+
const _1 = require(".");
|
|
7
7
|
exports.CarrierAppMetadataSchema = joi_1.default.object({
|
|
8
8
|
Id: joi_1.default.string()
|
|
9
9
|
.uuid({ version: ['uuidv4'] })
|
|
10
10
|
.required(),
|
|
11
11
|
Name: joi_1.default.string().required(),
|
|
12
|
+
AuthProcess: _1.AuthSpecificationSchema.optional(),
|
|
12
13
|
Carriers: joi_1.default.array()
|
|
13
14
|
.unique('Id')
|
|
14
15
|
.required()
|
|
15
16
|
.min(1)
|
|
16
17
|
.message('There must be at least 1 Carrier defined')
|
|
17
|
-
.items(
|
|
18
|
+
.items(_1.CarrierSchema),
|
|
18
19
|
});
|
|
19
20
|
//# sourceMappingURL=carrier-app-metadata.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carrier-app-metadata.js","sourceRoot":"","sources":["../../../src/app/metadata/carrier-app-metadata.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,
|
|
1
|
+
{"version":3,"file":"carrier-app-metadata.js","sourceRoot":"","sources":["../../../src/app/metadata/carrier-app-metadata.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,wBAKW;AAaE,QAAA,wBAAwB,GAAG,aAAG,CAAC,MAAM,CAAC;IACjD,EAAE,EAAE,aAAG,CAAC,MAAM,EAAE;SACb,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;SAC7B,QAAQ,EAAE;IACb,IAAI,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,WAAW,EAAE,0BAAuB,CAAC,QAAQ,EAAE;IAC/C,QAAQ,EAAE,aAAG,CAAC,KAAK,EAAE;SAClB,MAAM,CAAC,IAAI,CAAC;SACZ,QAAQ,EAAE;SACV,GAAG,CAAC,CAAC,CAAC;SACN,OAAO,CAAC,0CAA0C,CAAC;SACnD,KAAK,CAAC,gBAAa,CAAC;CACxB,CAAC,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './account-modals';
|
|
2
|
+
export * from './auth-identifier';
|
|
3
|
+
export * from './auth-specification';
|
|
4
|
+
export * from './carrier';
|
|
2
5
|
export * from './carrier-app-metadata';
|
|
3
6
|
export * from './carrier-attributes';
|
|
4
|
-
export * from './carrier';
|
|
5
7
|
export * from './confirmation-type';
|
|
6
8
|
export * from './country-association';
|
|
7
9
|
export * from './diagnostic-routes';
|
|
@@ -9,6 +11,7 @@ export * from './enums';
|
|
|
9
11
|
export * from './function';
|
|
10
12
|
export * from './label-formats';
|
|
11
13
|
export * from './label-sizes';
|
|
14
|
+
export * from './monoauth';
|
|
12
15
|
export * from './package-type';
|
|
13
16
|
export * from './service-class';
|
|
14
17
|
export * from './service-grade';
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./account-modals"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./auth-identifier"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./auth-specification"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./carrier"), exports);
|
|
5
8
|
tslib_1.__exportStar(require("./carrier-app-metadata"), exports);
|
|
6
9
|
tslib_1.__exportStar(require("./carrier-attributes"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./carrier"), exports);
|
|
8
10
|
tslib_1.__exportStar(require("./confirmation-type"), exports);
|
|
9
11
|
tslib_1.__exportStar(require("./country-association"), exports);
|
|
10
12
|
tslib_1.__exportStar(require("./diagnostic-routes"), exports);
|
|
@@ -12,6 +14,7 @@ tslib_1.__exportStar(require("./enums"), exports);
|
|
|
12
14
|
tslib_1.__exportStar(require("./function"), exports);
|
|
13
15
|
tslib_1.__exportStar(require("./label-formats"), exports);
|
|
14
16
|
tslib_1.__exportStar(require("./label-sizes"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./monoauth"), exports);
|
|
15
18
|
tslib_1.__exportStar(require("./package-type"), exports);
|
|
16
19
|
tslib_1.__exportStar(require("./service-class"), exports);
|
|
17
20
|
tslib_1.__exportStar(require("./service-grade"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/metadata/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/metadata/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC;AACjC,4DAAkC;AAClC,+DAAqC;AACrC,oDAA0B;AAC1B,iEAAuC;AACvC,+DAAqC;AACrC,8DAAoC;AACpC,gEAAsC;AACtC,8DAAoC;AACpC,kDAAwB;AACxB,qDAA2B;AAC3B,0DAAgC;AAChC,wDAA8B;AAC9B,qDAA2B;AAC3B,yDAA+B;AAC/B,0DAAgC;AAChC,0DAAgC;AAChC,wEAA8C;AAC9C,gEAAsC;AACtC,4DAAkC;AAClC,wEAA8C;AAC9C,6DAAmC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
export declare class Parameter {
|
|
3
|
+
/** @description The name of the parameter */
|
|
4
|
+
name: string;
|
|
5
|
+
/** @description The value associated with the parameter */
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const MethodSchema: Joi.StringSchema;
|
|
9
|
+
export declare const ParameterSchema: Joi.ObjectSchema<any>;
|
|
10
|
+
export declare class DateTimeConfiguration {
|
|
11
|
+
/** @description JSONPath to the JSON element containing the date-time */
|
|
12
|
+
path: string;
|
|
13
|
+
/** @description DateTime format string compliant with
|
|
14
|
+
* https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings */
|
|
15
|
+
date_time_format: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const DateTimeConfigurationSchema: Joi.ObjectSchema<any>;
|
|
18
|
+
export declare type MapOfStrings = {
|
|
19
|
+
[key: string]: string;
|
|
20
|
+
};
|
|
21
|
+
/** @description Optional configuration to take full control of parsing and extracting fields
|
|
22
|
+
* from the integration's JSON response body.
|
|
23
|
+
* Note for JSONPath: strings not starting with $ are interpreted as string literals
|
|
24
|
+
*/
|
|
25
|
+
export declare class ResponseTransformationConfiguration {
|
|
26
|
+
/** @description JSONPath to the JSON element for access_token. */
|
|
27
|
+
access_token: string;
|
|
28
|
+
/** @description JSONPath to the JSON element for token_type */
|
|
29
|
+
token_type: string;
|
|
30
|
+
/** @description JSONPath to the JSON element for refresh_token */
|
|
31
|
+
refresh_token?: string;
|
|
32
|
+
/** @description JSONPath to the JSON element for expires_in. Mutually exclusive with expires_at */
|
|
33
|
+
expires_in?: string;
|
|
34
|
+
/** @description Configuration for parsing a date-time, when the integration is lacking expires_in.
|
|
35
|
+
* Mutually exclusive with expires_in.
|
|
36
|
+
*/
|
|
37
|
+
expires_at?: DateTimeConfiguration;
|
|
38
|
+
/** @description Optional collection of properties to include in the connection_context sent back with the auth flow result.
|
|
39
|
+
* Property value may be JSONPath or a string literal.
|
|
40
|
+
* E.g.
|
|
41
|
+
* "connection_context": {
|
|
42
|
+
* "account_number": "$.data.account_number"
|
|
43
|
+
* }
|
|
44
|
+
*/
|
|
45
|
+
connection_context?: MapOfStrings;
|
|
46
|
+
}
|
|
47
|
+
export declare const MapOfStringsSchema: Joi.ObjectSchema<any>;
|
|
48
|
+
export declare const ResponseTransformationConfigurationSchema: Joi.ObjectSchema<any>;
|
|
49
|
+
export declare class AccessToken {
|
|
50
|
+
/** @description OAuth1 only. The url to obtain the temporary Access (aka Request) Token to start a flow **/
|
|
51
|
+
url_template: string;
|
|
52
|
+
}
|
|
53
|
+
export declare const AccessTokenSchema: Joi.ObjectSchema<any>;
|
|
54
|
+
export declare class RequestTokenConfiguration {
|
|
55
|
+
/** @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" */
|
|
56
|
+
url_template: string;
|
|
57
|
+
/** @description A list of query parameters that will be attached to the url */
|
|
58
|
+
query_parameters?: Parameter[];
|
|
59
|
+
/** @description Method to use when making the server-server code for token request @example "GET", "POST" */
|
|
60
|
+
method?: string;
|
|
61
|
+
/** @description List of parameters that are sent to the integration when exchanging the code for the token. These are built using ContentType */
|
|
62
|
+
body?: Parameter[];
|
|
63
|
+
/** @description List of headers that are sent to the integration when requesting a token */
|
|
64
|
+
headers?: Parameter[];
|
|
65
|
+
/** @description Response payload parsing */
|
|
66
|
+
response?: ResponseTransformationConfiguration;
|
|
67
|
+
}
|
|
68
|
+
export declare const RequestTokenConfigurationSchema: Joi.ObjectSchema<any>;
|
|
69
|
+
export declare class RefreshTokenConfiguration {
|
|
70
|
+
/** @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" */
|
|
71
|
+
url_template: string;
|
|
72
|
+
/** @description A list of query parameters that will be attached to the url */
|
|
73
|
+
query_parameters?: Parameter[];
|
|
74
|
+
/** @description Method to use when making the server-server code for token request @example "GET", "POST" */
|
|
75
|
+
method?: string;
|
|
76
|
+
/** @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. */
|
|
77
|
+
body?: Parameter[];
|
|
78
|
+
/** @description List of headers that are sent to the integration when refreshing a token */
|
|
79
|
+
headers?: Parameter[];
|
|
80
|
+
/** @description Response payload parsing */
|
|
81
|
+
response?: ResponseTransformationConfiguration;
|
|
82
|
+
}
|
|
83
|
+
export declare const RefreshTokenConfigurationSchema: Joi.ObjectSchema<any>;
|
|
84
|
+
export declare class NonceConfiguration {
|
|
85
|
+
name: string;
|
|
86
|
+
}
|
|
87
|
+
export declare const NonceConfigurationSchema: Joi.ObjectSchema<any>;
|
|
88
|
+
export declare class AuthorizationConfiguration {
|
|
89
|
+
/** @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" */
|
|
90
|
+
url_template: string;
|
|
91
|
+
/** @description A list of query parameters that will be attached to the url */
|
|
92
|
+
query_parameters?: Parameter[];
|
|
93
|
+
/** @description Method to use when making the server-server code for token request @example "GET", "POST" */
|
|
94
|
+
method?: string;
|
|
95
|
+
/** @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. */
|
|
96
|
+
body?: Parameter[];
|
|
97
|
+
/** @description List of headers that are sent to the integration when authorizing a token */
|
|
98
|
+
headers?: Parameter[];
|
|
99
|
+
/** @description A nonce query parameter included on the accept request, then returned and validated on the redirect request */
|
|
100
|
+
nonce?: NonceConfiguration;
|
|
101
|
+
}
|
|
102
|
+
export declare const AuthorizationConfigurationSchema: Joi.ObjectSchema<any>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthorizationConfigurationSchema = exports.AuthorizationConfiguration = exports.NonceConfigurationSchema = exports.NonceConfiguration = exports.RefreshTokenConfigurationSchema = exports.RefreshTokenConfiguration = exports.RequestTokenConfigurationSchema = exports.RequestTokenConfiguration = exports.AccessTokenSchema = exports.AccessToken = exports.ResponseTransformationConfigurationSchema = exports.MapOfStringsSchema = exports.ResponseTransformationConfiguration = exports.DateTimeConfigurationSchema = exports.DateTimeConfiguration = exports.ParameterSchema = exports.MethodSchema = exports.Parameter = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
6
|
+
class Parameter {
|
|
7
|
+
}
|
|
8
|
+
exports.Parameter = Parameter;
|
|
9
|
+
exports.MethodSchema = joi_1.default.string().valid('GET', 'POST', 'DELETE', 'PUT', 'get', 'post', 'delete', 'put');
|
|
10
|
+
exports.ParameterSchema = joi_1.default.object({
|
|
11
|
+
name: joi_1.default.string().required(),
|
|
12
|
+
value: joi_1.default.string().required(),
|
|
13
|
+
});
|
|
14
|
+
class DateTimeConfiguration {
|
|
15
|
+
}
|
|
16
|
+
exports.DateTimeConfiguration = DateTimeConfiguration;
|
|
17
|
+
exports.DateTimeConfigurationSchema = joi_1.default.object({
|
|
18
|
+
path: joi_1.default.string().required(),
|
|
19
|
+
date_time_format: joi_1.default.string().required(),
|
|
20
|
+
});
|
|
21
|
+
/** @description Optional configuration to take full control of parsing and extracting fields
|
|
22
|
+
* from the integration's JSON response body.
|
|
23
|
+
* Note for JSONPath: strings not starting with $ are interpreted as string literals
|
|
24
|
+
*/
|
|
25
|
+
class ResponseTransformationConfiguration {
|
|
26
|
+
}
|
|
27
|
+
exports.ResponseTransformationConfiguration = ResponseTransformationConfiguration;
|
|
28
|
+
exports.MapOfStringsSchema = joi_1.default.object().pattern(joi_1.default.string(), joi_1.default.string());
|
|
29
|
+
exports.ResponseTransformationConfigurationSchema = joi_1.default.object({
|
|
30
|
+
access_token: joi_1.default.string().required(),
|
|
31
|
+
token_type: joi_1.default.string().required(),
|
|
32
|
+
refresh_token: joi_1.default.string().optional(),
|
|
33
|
+
expires_in: joi_1.default.string().optional(),
|
|
34
|
+
expires_at: exports.DateTimeConfigurationSchema.optional(),
|
|
35
|
+
connection_context: exports.MapOfStringsSchema.optional(),
|
|
36
|
+
});
|
|
37
|
+
class AccessToken {
|
|
38
|
+
}
|
|
39
|
+
exports.AccessToken = AccessToken;
|
|
40
|
+
exports.AccessTokenSchema = joi_1.default.object({
|
|
41
|
+
url_template: joi_1.default.string().required(),
|
|
42
|
+
});
|
|
43
|
+
class RequestTokenConfiguration {
|
|
44
|
+
}
|
|
45
|
+
exports.RequestTokenConfiguration = RequestTokenConfiguration;
|
|
46
|
+
exports.RequestTokenConfigurationSchema = joi_1.default.object({
|
|
47
|
+
url_template: joi_1.default.string().required(),
|
|
48
|
+
query_parameters: joi_1.default.array().optional().items(exports.ParameterSchema),
|
|
49
|
+
method: exports.MethodSchema.optional(),
|
|
50
|
+
body: joi_1.default.array().optional().items(exports.ParameterSchema),
|
|
51
|
+
headers: joi_1.default.array().optional().items(exports.ParameterSchema),
|
|
52
|
+
response: exports.ResponseTransformationConfigurationSchema.optional(),
|
|
53
|
+
});
|
|
54
|
+
class RefreshTokenConfiguration {
|
|
55
|
+
}
|
|
56
|
+
exports.RefreshTokenConfiguration = RefreshTokenConfiguration;
|
|
57
|
+
exports.RefreshTokenConfigurationSchema = joi_1.default.object({
|
|
58
|
+
url_template: joi_1.default.string().required(),
|
|
59
|
+
query_parameters: joi_1.default.array().optional().items(exports.ParameterSchema),
|
|
60
|
+
method: exports.MethodSchema.optional(),
|
|
61
|
+
body: joi_1.default.array().optional().items(exports.ParameterSchema),
|
|
62
|
+
headers: joi_1.default.array().optional().items(exports.ParameterSchema),
|
|
63
|
+
response: exports.ResponseTransformationConfigurationSchema.optional(),
|
|
64
|
+
});
|
|
65
|
+
class NonceConfiguration {
|
|
66
|
+
}
|
|
67
|
+
exports.NonceConfiguration = NonceConfiguration;
|
|
68
|
+
exports.NonceConfigurationSchema = joi_1.default.object({
|
|
69
|
+
name: joi_1.default.string().required(),
|
|
70
|
+
});
|
|
71
|
+
class AuthorizationConfiguration {
|
|
72
|
+
}
|
|
73
|
+
exports.AuthorizationConfiguration = AuthorizationConfiguration;
|
|
74
|
+
exports.AuthorizationConfigurationSchema = joi_1.default.object({
|
|
75
|
+
url_template: joi_1.default.string().required(),
|
|
76
|
+
query_parameters: joi_1.default.array().optional().items(exports.ParameterSchema),
|
|
77
|
+
method: exports.MethodSchema.optional(),
|
|
78
|
+
body: joi_1.default.array().optional().items(exports.ParameterSchema),
|
|
79
|
+
headers: joi_1.default.array().optional().items(exports.ParameterSchema),
|
|
80
|
+
nonce: exports.NonceConfigurationSchema.optional(),
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=monoauth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monoauth.js","sourceRoot":"","sources":["../../../src/app/metadata/monoauth.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AAEtB,MAAa,SAAS;CAKrB;AALD,8BAKC;AAEY,QAAA,YAAY,GAAG,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAC5C,KAAK,EACL,MAAM,EACN,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,KAAK,CACN,CAAC;AAEW,QAAA,eAAe,GAAG,aAAG,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAa,qBAAqB;CAMjC;AAND,sDAMC;AAEY,QAAA,2BAA2B,GAAG,aAAG,CAAC,MAAM,CAAC;IACpD,IAAI,EAAE,aAAG,CAAC,MAAM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KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,uBAAe,CAAC;IACnD,OAAO,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,uBAAe,CAAC;IACtD,KAAK,EAAE,gCAAwB,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/app/carrier-app.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { resolve } from 'path';
|
|
|
5
5
|
import { readFileSync, existsSync } from 'fs';
|
|
6
6
|
|
|
7
7
|
import { Metadata } from './internal/metadata';
|
|
8
|
-
import { CarrierSpecification } from './internal/carrier-
|
|
8
|
+
import { CarrierSpecification } from './internal/carrier-specification';
|
|
9
9
|
import { CarrierAppMetadataSchema } from './metadata';
|
|
10
10
|
import {
|
|
11
11
|
RegisterResponseSchema,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { AuthSpecification } from '../metadata/auth-specification';
|
|
1
2
|
import { ShippingProviderConnector } from '../metadata/shipping-provider-connector';
|
|
2
|
-
import { CarrierSpecification } from './carrier-
|
|
3
|
+
import { CarrierSpecification } from './carrier-specification';
|
|
3
4
|
|
|
4
5
|
/** @description This represents a single integration which may contain multiple carrier sources */
|
|
5
6
|
export interface CarrierAppSpecification {
|
|
@@ -9,6 +10,8 @@ export interface CarrierAppSpecification {
|
|
|
9
10
|
Name: string;
|
|
10
11
|
/** @description Information about the connector */
|
|
11
12
|
Connector: ShippingProviderConnector;
|
|
13
|
+
/** @description The specification for authorizing with this carrier */
|
|
14
|
+
AuthProcess?: AuthSpecification;
|
|
12
15
|
/** @description A list of carrier sources associated with this integration */
|
|
13
16
|
Carriers: CarrierSpecification[];
|
|
14
17
|
}
|
|
File without changes
|
|
@@ -2,8 +2,9 @@ import { CarrierAppDefinition } from '../carrier-app-definition';
|
|
|
2
2
|
import { ShippingProviderConnector } from '../metadata/shipping-provider-connector';
|
|
3
3
|
import { FunctionSpecification } from '../metadata/function';
|
|
4
4
|
|
|
5
|
-
import { CarrierAppSpecification } from './carrier-app-
|
|
6
|
-
import { CarrierSpecification } from './carrier-
|
|
5
|
+
import { CarrierAppSpecification } from './carrier-app-specification';
|
|
6
|
+
import { CarrierSpecification } from './carrier-specification';
|
|
7
|
+
import { AuthSpecification } from '../metadata/auth-specification';
|
|
7
8
|
|
|
8
9
|
const fn = (name: string): FunctionSpecification => ({
|
|
9
10
|
Name: name,
|
|
@@ -52,11 +53,16 @@ export class Metadata implements CarrierAppSpecification {
|
|
|
52
53
|
Id: string;
|
|
53
54
|
Name: string;
|
|
54
55
|
Connector: ShippingProviderConnector;
|
|
56
|
+
AuthProcess?: AuthSpecification;
|
|
55
57
|
Carriers: CarrierSpecification[];
|
|
56
58
|
|
|
57
59
|
constructor(app: CarrierAppDefinition) {
|
|
58
60
|
this.Id = app.Metadata.Id;
|
|
59
61
|
this.Name = app.Metadata.Name;
|
|
62
|
+
this.AuthProcess = app.Metadata.AuthProcess;
|
|
63
|
+
if (this.AuthProcess) {
|
|
64
|
+
this.AuthProcess.Identifier.Version = '2.0';
|
|
65
|
+
}
|
|
60
66
|
this.Carriers = app.Metadata.Carriers.map(
|
|
61
67
|
(c) => new CarrierSpecification(c),
|
|
62
68
|
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
|
|
3
|
+
export enum AuthenticationType {
|
|
4
|
+
OAuth = 'oauth',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export class AuthIdentifier {
|
|
8
|
+
AuthenticationType!: AuthenticationType;
|
|
9
|
+
Version?: string;
|
|
10
|
+
IsSandbox?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const AuthIdentifierSchema = Joi.object({
|
|
14
|
+
AuthenticationType: Joi.string().required().valid('oauth'),
|
|
15
|
+
Version: Joi.string().optional(),
|
|
16
|
+
IsSandbox: Joi.bool().optional(),
|
|
17
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AuthIdentifier, AuthIdentifierSchema } from './auth-identifier';
|
|
2
|
+
import {
|
|
3
|
+
AccessToken,
|
|
4
|
+
AccessTokenSchema,
|
|
5
|
+
AuthorizationConfiguration,
|
|
6
|
+
AuthorizationConfigurationSchema,
|
|
7
|
+
Parameter,
|
|
8
|
+
ParameterSchema,
|
|
9
|
+
RefreshTokenConfiguration,
|
|
10
|
+
RefreshTokenConfigurationSchema,
|
|
11
|
+
RequestTokenConfiguration,
|
|
12
|
+
RequestTokenConfigurationSchema,
|
|
13
|
+
} from './monoauth';
|
|
14
|
+
import Joi from 'joi';
|
|
15
|
+
|
|
16
|
+
/** @description Used to specify information about an integrations authentication */
|
|
17
|
+
export class AuthSpecification {
|
|
18
|
+
/** @description Identify the type of Auth being used by the integration */
|
|
19
|
+
Identifier!: AuthIdentifier;
|
|
20
|
+
/** @description Added to allow oauth 1.0 to work. */
|
|
21
|
+
access_token?: AccessToken;
|
|
22
|
+
/** @description Authorization: the beginning of an OAuth2.0 flow that ensures the user is logged in and approves access to the Resource. */
|
|
23
|
+
authorization?: AuthorizationConfiguration;
|
|
24
|
+
/** @description Request Token: server-server code for token exchange */
|
|
25
|
+
request_token?: RequestTokenConfiguration;
|
|
26
|
+
/** @description Refresh Token: server-server refresh token exchange for access token **NOTE: sometimes a new RT is also created** */
|
|
27
|
+
refresh_token?: RefreshTokenConfiguration;
|
|
28
|
+
/** @description Advanced configurations used for oauth 1.0 */
|
|
29
|
+
advanced_configuration?: Parameter[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const AuthSpecificationSchema = Joi.object({
|
|
33
|
+
Identifier: AuthIdentifierSchema,
|
|
34
|
+
access_token: AccessTokenSchema.optional(),
|
|
35
|
+
authorization: AuthorizationConfigurationSchema.optional(),
|
|
36
|
+
request_token: RequestTokenConfigurationSchema.optional(),
|
|
37
|
+
refresh_token: RefreshTokenConfigurationSchema.optional(),
|
|
38
|
+
advanced_configuration: Joi.array().optional().items(ParameterSchema),
|
|
39
|
+
});
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AuthSpecification,
|
|
4
|
+
AuthSpecificationSchema,
|
|
5
|
+
Carrier,
|
|
6
|
+
CarrierSchema,
|
|
7
|
+
} from '.';
|
|
3
8
|
|
|
4
9
|
export interface CarrierAppMetadata {
|
|
5
10
|
/** @description Id of the carrier app */
|
|
6
11
|
Id: string;
|
|
7
12
|
/** @description Name of the carrier */
|
|
8
13
|
Name: string;
|
|
14
|
+
/** @description The specification for authorizing with this order source */
|
|
15
|
+
AuthProcess?: AuthSpecification;
|
|
9
16
|
/** @description List of carriers for the app */
|
|
10
17
|
Carriers: Carrier[];
|
|
11
18
|
}
|
|
@@ -15,6 +22,7 @@ export const CarrierAppMetadataSchema = Joi.object({
|
|
|
15
22
|
.uuid({ version: ['uuidv4'] })
|
|
16
23
|
.required(),
|
|
17
24
|
Name: Joi.string().required(),
|
|
25
|
+
AuthProcess: AuthSpecificationSchema.optional(),
|
|
18
26
|
Carriers: Joi.array()
|
|
19
27
|
.unique('Id')
|
|
20
28
|
.required()
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './account-modals';
|
|
2
|
+
export * from './auth-identifier';
|
|
3
|
+
export * from './auth-specification';
|
|
4
|
+
export * from './carrier';
|
|
2
5
|
export * from './carrier-app-metadata';
|
|
3
6
|
export * from './carrier-attributes';
|
|
4
|
-
export * from './carrier';
|
|
5
7
|
export * from './confirmation-type';
|
|
6
8
|
export * from './country-association';
|
|
7
9
|
export * from './diagnostic-routes';
|
|
@@ -9,6 +11,7 @@ export * from './enums';
|
|
|
9
11
|
export * from './function';
|
|
10
12
|
export * from './label-formats';
|
|
11
13
|
export * from './label-sizes';
|
|
14
|
+
export * from './monoauth';
|
|
12
15
|
export * from './package-type';
|
|
13
16
|
export * from './service-class';
|
|
14
17
|
export * from './service-grade';
|