@gls_spain/gps-common 34.9.1 → 34.9.3
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/.eslintignore +1 -1
- package/.eslintrc.json +11 -11
- package/.idea/codeStyles/Project.xml +36 -36
- package/.idea/codeStyles/codeStyleConfig.xml +4 -4
- package/.idea/gps-common.iml +11 -11
- package/.idea/inspectionProfiles/Project_Default.xml +6 -6
- package/.idea/jsLibraryMappings.xml +5 -5
- package/.idea/misc.xml +5 -5
- package/.idea/modules.xml +7 -7
- package/.idea/prettier.xml +6 -6
- package/.idea/scopes/Source_files.xml +2 -2
- package/.idea/vcs.xml +5 -5
- package/.prettierignore +4 -4
- package/.prettierrc.json +13 -13
- package/.releaserc +17 -17
- package/CHANGELOG.md +1264 -1250
- package/README.md +103 -103
- package/errors/CountersDoNotExistError.js +11 -11
- package/errors/DatabaseNotEmptyError.js +11 -11
- package/errors/DefaultsDoNotExistError.js +11 -11
- package/errors/ExpeditionAlreadyExistsError.js +11 -11
- package/errors/ExpeditionCannotBeDeletedError.js +11 -11
- package/errors/ExpeditionCannotBeUpdatedError.js +11 -11
- package/errors/ExpeditionDoesNotExistError.js +11 -11
- package/errors/GLSRecordingError.js +11 -11
- package/errors/GLSSpainError.js +11 -11
- package/errors/InconsistentSalesSettingsError.js +11 -11
- package/errors/InvalidSaleDestinationError.js +11 -11
- package/errors/LabelDoesNotExistError.js +11 -11
- package/errors/NetworkAlreadyExistsError.js +11 -11
- package/errors/NetworkCannotBeDeletedError.js +11 -11
- package/errors/NetworkCannotBeUpdatedError.js +11 -11
- package/errors/NetworkDoesNotExistError.js +11 -11
- package/errors/RepresentativeAlreadyExistsError.js +11 -11
- package/errors/RepresentativeCannotBeDeletedError.js +11 -11
- package/errors/RepresentativeDoesNotExistError.js +11 -11
- package/errors/SaleAlreadyExistsError.js +11 -11
- package/errors/SaleDoesNotExistError.js +11 -11
- package/errors/ShopAlreadyExistsError.js +11 -11
- package/errors/ShopCannotBeDeletedError.js +11 -11
- package/errors/ShopCannotBeUpdatedError.js +11 -11
- package/errors/ShopCannotSellError.js +11 -11
- package/errors/ShopDoesNotExistError.js +11 -11
- package/errors/ShopNotEnabledError.js +11 -11
- package/errors/UserAlreadyExistsError.js +11 -11
- package/errors/UserCannotBeDeletedError.js +11 -11
- package/errors/UserCannotBeUpdatedError.js +11 -11
- package/errors/UserDoesNotExistError.js +11 -11
- package/errors/WrongNetworkError.js +11 -11
- package/errors/WrongPasswordError.js +11 -11
- package/errors/WrongShopError.js +11 -11
- package/errors/ZoneAlreadyExistsError.js +11 -11
- package/errors/ZoneCannotBeDeletedError.js +11 -11
- package/errors/ZoneDoesNotExistError.js +11 -11
- package/errors/index.js +118 -118
- package/index.js +9 -9
- package/index.test.js +36 -36
- package/jest.config.js +5 -5
- package/open-api-spec/index.js +3715 -3715
- package/package.json +65 -69
- package/schemas/definitions/become.js +5 -5
- package/schemas/definitions/common.js +462 -440
- package/schemas/definitions/counters.js +43 -43
- package/schemas/definitions/defaults.js +140 -140
- package/schemas/definitions/expeditions.js +867 -867
- package/schemas/definitions/gls-spain-integration-events.js +139 -139
- package/schemas/definitions/historic-records.js +90 -90
- package/schemas/definitions/integrations.js +38 -38
- package/schemas/definitions/login.js +38 -38
- package/schemas/definitions/logout.js +8 -8
- package/schemas/definitions/networks.js +123 -123
- package/schemas/definitions/pods.js +26 -26
- package/schemas/definitions/representatives.js +194 -194
- package/schemas/definitions/sales.js +253 -249
- package/schemas/definitions/shops.js +404 -404
- package/schemas/definitions/users.js +337 -337
- package/schemas/definitions/zones.js +92 -92
- package/schemas/index.js +400 -400
- package/scripts/build-documentation.js +40 -40
- package/scripts/build-json-schemas.js +35 -35
- package/.idea/workspace.xml +0 -696
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const util = require('util');
|
|
6
|
-
const os = require('os');
|
|
7
|
-
const childProcess = require('child_process');
|
|
8
|
-
const winston = require('winston');
|
|
9
|
-
const { ColorConsoleTransport } = require('@gls_spain/winston-transports');
|
|
10
|
-
const yargs = require('yargs');
|
|
11
|
-
const openApiSpec = require('../open-api-spec');
|
|
12
|
-
|
|
13
|
-
const exec = util.promisify(childProcess.exec);
|
|
14
|
-
|
|
15
|
-
const { argv } = yargs
|
|
16
|
-
.option('output', { string: true, required: true, describe: 'path to the html file to create' })
|
|
17
|
-
.usage('Usage: build-documentation --output output_file');
|
|
18
|
-
|
|
19
|
-
const logger = winston.createLogger({ transports: new ColorConsoleTransport() });
|
|
20
|
-
|
|
21
|
-
async function buildDocumentation() {
|
|
22
|
-
const tmpDir = os.tmpdir();
|
|
23
|
-
const jsonPath = path.resolve(tmpDir, 'open-api-spec.json');
|
|
24
|
-
|
|
25
|
-
logger.info(`output file is: ${argv.output}`);
|
|
26
|
-
logger.info('creating output directory...');
|
|
27
|
-
fs.mkdirSync(path.dirname(path.resolve(argv.output)), { recursive: true });
|
|
28
|
-
|
|
29
|
-
logger.info('writing html file...');
|
|
30
|
-
fs.writeFileSync(jsonPath, JSON.stringify(openApiSpec, null, 2));
|
|
31
|
-
const redocCli = require.resolve('redoc-cli');
|
|
32
|
-
await exec(
|
|
33
|
-
`"${redocCli}" bundle ${jsonPath} --output ${argv.output} --options.noAutoAuth --options.hideDownloadButton --options.menuToggle=true --title="GLS Parcel Shops API"`,
|
|
34
|
-
);
|
|
35
|
-
logger.info('done');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
buildDocumentation()
|
|
39
|
-
.catch(error => logger.error(error))
|
|
40
|
-
.then(() => process.exit());
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const util = require('util');
|
|
6
|
+
const os = require('os');
|
|
7
|
+
const childProcess = require('child_process');
|
|
8
|
+
const winston = require('winston');
|
|
9
|
+
const { ColorConsoleTransport } = require('@gls_spain/winston-transports');
|
|
10
|
+
const yargs = require('yargs');
|
|
11
|
+
const openApiSpec = require('../open-api-spec');
|
|
12
|
+
|
|
13
|
+
const exec = util.promisify(childProcess.exec);
|
|
14
|
+
|
|
15
|
+
const { argv } = yargs
|
|
16
|
+
.option('output', { string: true, required: true, describe: 'path to the html file to create' })
|
|
17
|
+
.usage('Usage: build-documentation --output output_file');
|
|
18
|
+
|
|
19
|
+
const logger = winston.createLogger({ transports: new ColorConsoleTransport() });
|
|
20
|
+
|
|
21
|
+
async function buildDocumentation() {
|
|
22
|
+
const tmpDir = os.tmpdir();
|
|
23
|
+
const jsonPath = path.resolve(tmpDir, 'open-api-spec.json');
|
|
24
|
+
|
|
25
|
+
logger.info(`output file is: ${argv.output}`);
|
|
26
|
+
logger.info('creating output directory...');
|
|
27
|
+
fs.mkdirSync(path.dirname(path.resolve(argv.output)), { recursive: true });
|
|
28
|
+
|
|
29
|
+
logger.info('writing html file...');
|
|
30
|
+
fs.writeFileSync(jsonPath, JSON.stringify(openApiSpec, null, 2));
|
|
31
|
+
const redocCli = require.resolve('redoc-cli');
|
|
32
|
+
await exec(
|
|
33
|
+
`"${redocCli}" bundle ${jsonPath} --output ${argv.output} --options.noAutoAuth --options.hideDownloadButton --options.menuToggle=true --title="GLS Parcel Shops API"`,
|
|
34
|
+
);
|
|
35
|
+
logger.info('done');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
buildDocumentation()
|
|
39
|
+
.catch(error => logger.error(error))
|
|
40
|
+
.then(() => process.exit());
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const winston = require('winston');
|
|
6
|
-
const kebabCase = require('lodash/kebabCase');
|
|
7
|
-
const yargs = require('yargs');
|
|
8
|
-
const { ColorConsoleTransport } = require('@gls_spain/winston-transports');
|
|
9
|
-
const schemas = require('../schemas');
|
|
10
|
-
|
|
11
|
-
const { argv } = yargs
|
|
12
|
-
.option('output', { string: true, required: true, describe: 'directory path to put the json schemas in' })
|
|
13
|
-
.usage('Usage: build-schemas --output output_dir');
|
|
14
|
-
|
|
15
|
-
const logger = winston.createLogger({ transports: new ColorConsoleTransport() });
|
|
16
|
-
|
|
17
|
-
async function buildJsonSchemas() {
|
|
18
|
-
const schemasArray = Object.values(schemas);
|
|
19
|
-
logger.info(`found ${schemasArray.length} schemas`);
|
|
20
|
-
|
|
21
|
-
const outDirPath = path.resolve(argv.output);
|
|
22
|
-
logger.info(`output directory is: ${outDirPath}`);
|
|
23
|
-
|
|
24
|
-
logger.info('creating output directory...');
|
|
25
|
-
fs.mkdirSync(outDirPath, { recursive: true });
|
|
26
|
-
logger.info(`writing ${schemasArray.length} new files...`);
|
|
27
|
-
schemasArray.forEach(schema =>
|
|
28
|
-
fs.writeFileSync(path.resolve(outDirPath, `${kebabCase(schema.$id)}.json`), JSON.stringify(schema, null, 2)),
|
|
29
|
-
);
|
|
30
|
-
logger.info('done');
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
buildJsonSchemas()
|
|
34
|
-
.catch(error => logger.error(error))
|
|
35
|
-
.then(() => process.exit());
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const winston = require('winston');
|
|
6
|
+
const kebabCase = require('lodash/kebabCase');
|
|
7
|
+
const yargs = require('yargs');
|
|
8
|
+
const { ColorConsoleTransport } = require('@gls_spain/winston-transports');
|
|
9
|
+
const schemas = require('../schemas');
|
|
10
|
+
|
|
11
|
+
const { argv } = yargs
|
|
12
|
+
.option('output', { string: true, required: true, describe: 'directory path to put the json schemas in' })
|
|
13
|
+
.usage('Usage: build-schemas --output output_dir');
|
|
14
|
+
|
|
15
|
+
const logger = winston.createLogger({ transports: new ColorConsoleTransport() });
|
|
16
|
+
|
|
17
|
+
async function buildJsonSchemas() {
|
|
18
|
+
const schemasArray = Object.values(schemas);
|
|
19
|
+
logger.info(`found ${schemasArray.length} schemas`);
|
|
20
|
+
|
|
21
|
+
const outDirPath = path.resolve(argv.output);
|
|
22
|
+
logger.info(`output directory is: ${outDirPath}`);
|
|
23
|
+
|
|
24
|
+
logger.info('creating output directory...');
|
|
25
|
+
fs.mkdirSync(outDirPath, { recursive: true });
|
|
26
|
+
logger.info(`writing ${schemasArray.length} new files...`);
|
|
27
|
+
schemasArray.forEach(schema =>
|
|
28
|
+
fs.writeFileSync(path.resolve(outDirPath, `${kebabCase(schema.$id)}.json`), JSON.stringify(schema, null, 2)),
|
|
29
|
+
);
|
|
30
|
+
logger.info('done');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
buildJsonSchemas()
|
|
34
|
+
.catch(error => logger.error(error))
|
|
35
|
+
.then(() => process.exit());
|