@mojaloop/api-snippets 17.2.5 → 17.3.0
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/CHANGELOG.md +7 -0
- package/audit-ci.jsonc +1 -0
- package/docs/fspiop-rest-v1.0-openapi3-snippets.yaml +204 -805
- package/docs/fspiop-rest-v1.1-openapi3-snippets.yaml +2432 -2447
- package/docs/fspiop-rest-v2.0-openapi3-snippets.yaml +4841 -0
- package/docs/index.html +1 -0
- package/docs/sdk-scheme-adapter-backend-v2_0_0-openapi3-snippets.yaml +103 -345
- package/docs/sdk-scheme-adapter-outbound-v2_0_0-openapi3-snippets.yaml +150 -492
- package/docs/thirdparty-openapi3-snippets.yaml +296 -886
- package/fspiop/v1_1/openapi3/openapi.yaml +10 -2
- package/fspiop/v2_0/openapi3/components/headers/Content-Length.yaml +9 -0
- package/fspiop/v2_0/openapi3/components/headers/Content-Type.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/parameters/Accept.yaml +8 -0
- package/fspiop/v2_0/openapi3/components/parameters/Content-Length.yaml +11 -0
- package/fspiop/v2_0/openapi3/components/parameters/Content-Type.yaml +8 -0
- package/fspiop/v2_0/openapi3/components/parameters/Date.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/parameters/FSPIOP-Destination.yaml +13 -0
- package/fspiop/v2_0/openapi3/components/parameters/FSPIOP-Encryption.yaml +8 -0
- package/fspiop/v2_0/openapi3/components/parameters/FSPIOP-HTTP-Method.yaml +11 -0
- package/fspiop/v2_0/openapi3/components/parameters/FSPIOP-Signature.yaml +8 -0
- package/fspiop/v2_0/openapi3/components/parameters/FSPIOP-Source.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/parameters/FSPIOP-URI.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/parameters/ID.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/parameters/SourceCurrency.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/parameters/SubId.yaml +8 -0
- package/fspiop/v2_0/openapi3/components/parameters/TargetCurrency.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/parameters/Type.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/parameters/X-Forwarded-For.yaml +15 -0
- package/fspiop/v2_0/openapi3/components/responses/200.yaml +1 -0
- package/fspiop/v2_0/openapi3/components/responses/202.yaml +1 -0
- package/fspiop/v2_0/openapi3/components/responses/400.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/responses/401.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/responses/403.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/responses/404.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/responses/405.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/responses/406.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/responses/501.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/responses/503.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/schemas/Amount.yaml +11 -0
- package/fspiop/v2_0/openapi3/components/schemas/AmountType.yaml +14 -0
- package/fspiop/v2_0/openapi3/components/schemas/AuthenticationInfo.yaml +11 -0
- package/fspiop/v2_0/openapi3/components/schemas/AuthenticationType.yaml +12 -0
- package/fspiop/v2_0/openapi3/components/schemas/AuthenticationValue.yaml +9 -0
- package/fspiop/v2_0/openapi3/components/schemas/AuthorizationResponse.yaml +12 -0
- package/fspiop/v2_0/openapi3/components/schemas/AuthorizationsIDPutResponse.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/schemas/BalanceOfPayments.yaml +9 -0
- package/fspiop/v2_0/openapi3/components/schemas/BinaryString.yaml +7 -0
- package/fspiop/v2_0/openapi3/components/schemas/BinaryString32.yaml +7 -0
- package/fspiop/v2_0/openapi3/components/schemas/BulkQuotesIDPutResponse.yaml +18 -0
- package/fspiop/v2_0/openapi3/components/schemas/BulkQuotesPostRequest.yaml +25 -0
- package/fspiop/v2_0/openapi3/components/schemas/BulkTransferState.yaml +18 -0
- package/fspiop/v2_0/openapi3/components/schemas/BulkTransfersIDPutResponse.yaml +18 -0
- package/fspiop/v2_0/openapi3/components/schemas/BulkTransfersPostRequest.yaml +30 -0
- package/fspiop/v2_0/openapi3/components/schemas/Code.yaml +5 -0
- package/fspiop/v2_0/openapi3/components/schemas/CorrelationId.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/schemas/Currency.yaml +174 -0
- package/fspiop/v2_0/openapi3/components/schemas/CurrencyConverter.yaml +9 -0
- package/fspiop/v2_0/openapi3/components/schemas/Date.yaml +9 -0
- package/fspiop/v2_0/openapi3/components/schemas/DateOfBirth.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/schemas/DateTime.yaml +14 -0
- package/fspiop/v2_0/openapi3/components/schemas/ErrorCode.yaml +11 -0
- package/fspiop/v2_0/openapi3/components/schemas/ErrorDescription.yaml +5 -0
- package/fspiop/v2_0/openapi3/components/schemas/ErrorInformation.yaml +13 -0
- package/fspiop/v2_0/openapi3/components/schemas/ErrorInformationObject.yaml +8 -0
- package/fspiop/v2_0/openapi3/components/schemas/ErrorInformationResponse.yaml +8 -0
- package/fspiop/v2_0/openapi3/components/schemas/Extension.yaml +11 -0
- package/fspiop/v2_0/openapi3/components/schemas/ExtensionKey.yaml +5 -0
- package/fspiop/v2_0/openapi3/components/schemas/ExtensionList.yaml +15 -0
- package/fspiop/v2_0/openapi3/components/schemas/ExtensionValue.yaml +5 -0
- package/fspiop/v2_0/openapi3/components/schemas/FirstName.yaml +9 -0
- package/fspiop/v2_0/openapi3/components/schemas/FspId.yaml +5 -0
- package/fspiop/v2_0/openapi3/components/schemas/FxCharge.yaml +19 -0
- package/fspiop/v2_0/openapi3/components/schemas/FxConversion.yaml +57 -0
- package/fspiop/v2_0/openapi3/components/schemas/FxMoney.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/schemas/FxQuotesIDPutResponse.yaml +15 -0
- package/fspiop/v2_0/openapi3/components/schemas/FxQuotesPostRequest.yaml +15 -0
- package/fspiop/v2_0/openapi3/components/schemas/FxRate.yaml +15 -0
- package/fspiop/v2_0/openapi3/components/schemas/FxTransfersIDPatchResponse.yaml +16 -0
- package/fspiop/v2_0/openapi3/components/schemas/FxTransfersIDPutResponse.yaml +20 -0
- package/fspiop/v2_0/openapi3/components/schemas/FxTransfersPostRequest.yaml +41 -0
- package/fspiop/v2_0/openapi3/components/schemas/GeoCode.yaml +13 -0
- package/fspiop/v2_0/openapi3/components/schemas/IlpCondition.yaml +5 -0
- package/fspiop/v2_0/openapi3/components/schemas/IlpFulfilment.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/schemas/IlpPacket.yaml +7 -0
- package/fspiop/v2_0/openapi3/components/schemas/IndividualQuote.yaml +29 -0
- package/fspiop/v2_0/openapi3/components/schemas/IndividualQuoteResult.yaml +26 -0
- package/fspiop/v2_0/openapi3/components/schemas/IndividualTransfer.yaml +19 -0
- package/fspiop/v2_0/openapi3/components/schemas/IndividualTransferResult.yaml +14 -0
- package/fspiop/v2_0/openapi3/components/schemas/Integer.yaml +7 -0
- package/fspiop/v2_0/openapi3/components/schemas/KYCInformation.yaml +33 -0
- package/fspiop/v2_0/openapi3/components/schemas/LastName.yaml +9 -0
- package/fspiop/v2_0/openapi3/components/schemas/Latitude.yaml +7 -0
- package/fspiop/v2_0/openapi3/components/schemas/Longitude.yaml +8 -0
- package/fspiop/v2_0/openapi3/components/schemas/MerchantClassificationCode.yaml +7 -0
- package/fspiop/v2_0/openapi3/components/schemas/MiddleName.yaml +9 -0
- package/fspiop/v2_0/openapi3/components/schemas/Money.yaml +11 -0
- package/fspiop/v2_0/openapi3/components/schemas/Name.yaml +17 -0
- package/fspiop/v2_0/openapi3/components/schemas/Note.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/schemas/OtpValue.yaml +7 -0
- package/fspiop/v2_0/openapi3/components/schemas/ParticipantsIDPutResponse.yaml +17 -0
- package/fspiop/v2_0/openapi3/components/schemas/ParticipantsPostRequest.yaml +20 -0
- package/fspiop/v2_0/openapi3/components/schemas/ParticipantsTypeIDPutResponse.yaml +8 -0
- package/fspiop/v2_0/openapi3/components/schemas/ParticipantsTypeIDSubIDPostRequest.yaml +15 -0
- package/fspiop/v2_0/openapi3/components/schemas/PartiesTypeIDPutResponse.yaml +8 -0
- package/fspiop/v2_0/openapi3/components/schemas/Party.yaml +21 -0
- package/fspiop/v2_0/openapi3/components/schemas/PartyComplexName.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/schemas/PartyIdInfo.yaml +19 -0
- package/fspiop/v2_0/openapi3/components/schemas/PartyIdType.yaml +54 -0
- package/fspiop/v2_0/openapi3/components/schemas/PartyIdentifier.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/schemas/PartyName.yaml +5 -0
- package/fspiop/v2_0/openapi3/components/schemas/PartyPersonalInfo.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/schemas/PartyResult.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/schemas/PartySubIdOrType.yaml +7 -0
- package/fspiop/v2_0/openapi3/components/schemas/PersonalIdentifierType.yaml +51 -0
- package/fspiop/v2_0/openapi3/components/schemas/QRCODE.yaml +5 -0
- package/fspiop/v2_0/openapi3/components/schemas/QuotesIDPutResponse.yaml +27 -0
- package/fspiop/v2_0/openapi3/components/schemas/QuotesPostRequest.yaml +53 -0
- package/fspiop/v2_0/openapi3/components/schemas/Refund.yaml +10 -0
- package/fspiop/v2_0/openapi3/components/schemas/RefundReason.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/schemas/ServicesFXPPutResponse.yaml +13 -0
- package/fspiop/v2_0/openapi3/components/schemas/ServicesFXPSourceCurrencyTargetCurrencyPutResponse.yaml +13 -0
- package/fspiop/v2_0/openapi3/components/schemas/TokenCode.yaml +6 -0
- package/fspiop/v2_0/openapi3/components/schemas/Transaction.yaml +50 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransactionInitiator.yaml +16 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransactionInitiatorType.yaml +14 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransactionRequestState.yaml +14 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransactionRequestsIDPutResponse.yaml +12 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransactionRequestsPostRequest.yaml +30 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransactionScenario.yaml +32 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransactionState.yaml +14 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransactionSubScenario.yaml +5 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransactionType.yaml +20 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransactionsIDPutResponse.yaml +14 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransferState.yaml +19 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransfersIDPatchResponse.yaml +13 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransfersIDPutResponse.yaml +14 -0
- package/fspiop/v2_0/openapi3/components/schemas/TransfersPostRequest.yaml +28 -0
- package/fspiop/v2_0/openapi3/components/schemas/U2FPIN.yaml +8 -0
- package/fspiop/v2_0/openapi3/components/schemas/U2FPinValue.yaml +19 -0
- package/fspiop/v2_0/openapi3/components/schemas/UndefinedEnum.yaml +6 -0
- package/fspiop/v2_0/openapi3/openapi.yaml +136 -0
- package/fspiop/v2_0/openapi3/paths/authorizations_ID.yaml +110 -0
- package/fspiop/v2_0/openapi3/paths/authorizations_ID_error.yaml +48 -0
- package/fspiop/v2_0/openapi3/paths/bulkQuotes.yaml +46 -0
- package/fspiop/v2_0/openapi3/paths/bulkQuotes_ID.yaml +79 -0
- package/fspiop/v2_0/openapi3/paths/bulkQuotes_ID_error.yaml +49 -0
- package/fspiop/v2_0/openapi3/paths/bulkTransfers.yaml +46 -0
- package/fspiop/v2_0/openapi3/paths/bulkTransfers_ID.yaml +81 -0
- package/fspiop/v2_0/openapi3/paths/bulkTransfers_ID_error.yaml +49 -0
- package/fspiop/v2_0/openapi3/paths/fxQuotes.yaml +45 -0
- package/fspiop/v2_0/openapi3/paths/fxQuotes_ID.yaml +79 -0
- package/fspiop/v2_0/openapi3/paths/fxQuotes_ID_error.yaml +49 -0
- package/fspiop/v2_0/openapi3/paths/fxTransfers.yaml +45 -0
- package/fspiop/v2_0/openapi3/paths/fxTransfers_ID.yaml +118 -0
- package/fspiop/v2_0/openapi3/paths/fxTransfers_ID_error.yaml +49 -0
- package/fspiop/v2_0/openapi3/paths/participants.yaml +49 -0
- package/fspiop/v2_0/openapi3/paths/participants_ID.yaml +46 -0
- package/fspiop/v2_0/openapi3/paths/participants_ID_error.yaml +48 -0
- package/fspiop/v2_0/openapi3/paths/participants_Type_ID.yaml +167 -0
- package/fspiop/v2_0/openapi3/paths/participants_Type_ID_SubId.yaml +168 -0
- package/fspiop/v2_0/openapi3/paths/participants_Type_ID_SubId_error.yaml +50 -0
- package/fspiop/v2_0/openapi3/paths/participants_Type_ID_error.yaml +49 -0
- package/fspiop/v2_0/openapi3/paths/parties_Type_ID.yaml +81 -0
- package/fspiop/v2_0/openapi3/paths/parties_Type_ID_SubId.yaml +82 -0
- package/fspiop/v2_0/openapi3/paths/parties_Type_ID_SubId_error.yaml +50 -0
- package/fspiop/v2_0/openapi3/paths/parties_Type_ID_error.yaml +49 -0
- package/fspiop/v2_0/openapi3/paths/quotes.yaml +46 -0
- package/fspiop/v2_0/openapi3/paths/quotes_ID.yaml +79 -0
- package/fspiop/v2_0/openapi3/paths/quotes_ID_error.yaml +49 -0
- package/fspiop/v2_0/openapi3/paths/services_FXP.yaml +73 -0
- package/fspiop/v2_0/openapi3/paths/services_FXP_SourceCurrency_TargetCurrency.yaml +77 -0
- package/fspiop/v2_0/openapi3/paths/transactionRequests.yaml +47 -0
- package/fspiop/v2_0/openapi3/paths/transactionRequests_ID.yaml +81 -0
- package/fspiop/v2_0/openapi3/paths/transactionRequests_ID_error.yaml +50 -0
- package/fspiop/v2_0/openapi3/paths/transactions_ID.yaml +80 -0
- package/fspiop/v2_0/openapi3/paths/transactions_ID_error.yaml +48 -0
- package/fspiop/v2_0/openapi3/paths/transfers.yaml +46 -0
- package/fspiop/v2_0/openapi3/paths/transfers_ID.yaml +119 -0
- package/fspiop/v2_0/openapi3/paths/transfers_ID_error.yaml +49 -0
- package/lib/fspiop/v1_1/openapi.d.ts +524 -542
- package/lib/fspiop/v2_0/openapi.d.ts +3964 -0
- package/lib/fspiop/v2_0/openapi.js +7 -0
- package/lib/fspiop/v2_0/openapi.js.map +1 -0
- package/lib/scripts/json-schema-generator.js +4 -5
- package/lib/scripts/json-schema-generator.js.map +1 -1
- package/lib/scripts/openapi-refactor.d.ts +29 -0
- package/lib/scripts/openapi-refactor.js +70 -0
- package/lib/scripts/openapi-refactor.js.map +1 -0
- package/package.json +29 -21
- package/tsconfig.build.json +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"openapi.js","sourceRoot":"","sources":["../../../src/fspiop/v2_0/openapi.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
@@ -41,15 +41,14 @@ const openApiFile = myArgs[0];
|
|
41
41
|
const outputFolder = myArgs[1];
|
42
42
|
// console.log(file)
|
43
43
|
json_schema_ref_parser_1.default.dereference(openApiFile, (err, openApiSpecObj) => {
|
44
|
-
var _a, _b, _c, _d;
|
45
44
|
if (err) {
|
46
45
|
console.error(err);
|
47
46
|
process.exit(1);
|
48
47
|
}
|
49
48
|
const openApiSpec = openApiSpecObj;
|
50
|
-
if (
|
49
|
+
if (openApiSpec?.components?.schemas) {
|
51
50
|
// Write json file for schemas
|
52
|
-
fs_1.default.writeFile(outputFolder + '/json-schemas.json', JSON.stringify(
|
51
|
+
fs_1.default.writeFile(outputFolder + '/json-schemas.json', JSON.stringify(openApiSpec?.components?.schemas, null, 2), (err1) => {
|
53
52
|
if (err1) {
|
54
53
|
console.error(err1);
|
55
54
|
}
|
@@ -61,7 +60,7 @@ json_schema_ref_parser_1.default.dereference(openApiFile, (err, openApiSpecObj)
|
|
61
60
|
indexFileContent += '\n' + "import JsonSchemas from './json-schemas.json'";
|
62
61
|
indexFileContent += '\n';
|
63
62
|
indexFileContent += '\n' + 'export namespace Schemas {';
|
64
|
-
Object.keys(
|
63
|
+
Object.keys(openApiSpec?.components?.schemas).forEach((schemaName) => {
|
65
64
|
indexFileContent += '\n' + ` export const ${schemaName} = JsonSchemas.${schemaName}`;
|
66
65
|
});
|
67
66
|
indexFileContent += '\n' + '}';
|
@@ -79,7 +78,7 @@ json_schema_ref_parser_1.default.dereference(openApiFile, (err, openApiSpecObj)
|
|
79
78
|
typesFileContent += '\n' + "import { components } from './openapi'";
|
80
79
|
typesFileContent += '\n';
|
81
80
|
typesFileContent += '\n' + 'export namespace Types {';
|
82
|
-
Object.keys(
|
81
|
+
Object.keys(openApiSpec?.components?.schemas).forEach((schemaName) => {
|
83
82
|
typesFileContent += '\n' + ` export type ${schemaName} = components['schemas']['${schemaName}']`;
|
84
83
|
});
|
85
84
|
typesFileContent += '\n' + '}';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"json-schema-generator.js","sourceRoot":"","sources":["../../src/scripts/json-schema-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2BQ;AAER,YAAY,CAAA;;;AAEZ,oDAAmB;AACnB,0BAA0B;AAC1B,yGAA4D;AAE5D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACpC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;
|
1
|
+
{"version":3,"file":"json-schema-generator.js","sourceRoot":"","sources":["../../src/scripts/json-schema-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2BQ;AAER,YAAY,CAAA;;;AAEZ,oDAAmB;AACnB,0BAA0B;AAC1B,yGAA4D;AAE5D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACpC,IAAI,MAAM,CAAC,MAAM,K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A;QACnE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/*****
|
2
|
+
License
|
3
|
+
--------------
|
4
|
+
Copyright © 2017 Bill & Melinda Gates Foundation
|
5
|
+
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
10
|
+
|
11
|
+
Contributors
|
12
|
+
--------------
|
13
|
+
This is the official list (alphabetical ordering) of the Mojaloop project contributors for this file.
|
14
|
+
Names of the original copyright holders (individuals or organizations)
|
15
|
+
should be listed with a '*' in the first column. People who have
|
16
|
+
contributed from an organization can be listed under the organization
|
17
|
+
that actually holds the copyright for their contributions (see the
|
18
|
+
Gates Foundation organization for an example). Those individuals should have
|
19
|
+
their names indented and be marked with a '-'. Email address can be added
|
20
|
+
optionally within square brackets <email>.
|
21
|
+
|
22
|
+
* Gates Foundation
|
23
|
+
- Name Surname <name.surname@gatesfoundation.com>
|
24
|
+
* Modusbox
|
25
|
+
- Vijay Kumar Guthi <vijaya.guthi@modusbox.com>
|
26
|
+
|
27
|
+
--------------
|
28
|
+
******/
|
29
|
+
export {};
|
@@ -0,0 +1,70 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*****
|
3
|
+
License
|
4
|
+
--------------
|
5
|
+
Copyright © 2017 Bill & Melinda Gates Foundation
|
6
|
+
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
|
7
|
+
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
|
10
|
+
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
11
|
+
|
12
|
+
Contributors
|
13
|
+
--------------
|
14
|
+
This is the official list (alphabetical ordering) of the Mojaloop project contributors for this file.
|
15
|
+
Names of the original copyright holders (individuals or organizations)
|
16
|
+
should be listed with a '*' in the first column. People who have
|
17
|
+
contributed from an organization can be listed under the organization
|
18
|
+
that actually holds the copyright for their contributions (see the
|
19
|
+
Gates Foundation organization for an example). Those individuals should have
|
20
|
+
their names indented and be marked with a '-'. Email address can be added
|
21
|
+
optionally within square brackets <email>.
|
22
|
+
|
23
|
+
* Gates Foundation
|
24
|
+
- Name Surname <name.surname@gatesfoundation.com>
|
25
|
+
* Modusbox
|
26
|
+
- Vijay Kumar Guthi <vijaya.guthi@modusbox.com>
|
27
|
+
|
28
|
+
--------------
|
29
|
+
******/
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
31
|
+
const tslib_1 = require("tslib");
|
32
|
+
// Accepts an OpenAPI YAML file as input and alphabetically sorts the components section
|
33
|
+
// This is done to maintain a consistent order of components
|
34
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
35
|
+
const js_yaml_1 = tslib_1.__importDefault(require("js-yaml"));
|
36
|
+
const openapi_core_1 = require("@redocly/openapi-core");
|
37
|
+
const myArgs = process.argv.slice(2);
|
38
|
+
if (myArgs.length !== 2) {
|
39
|
+
console.log('Usage: openapi-sort-components.js <openapi-spec-yaml-file> <output-yaml-file>');
|
40
|
+
process.exit(1);
|
41
|
+
}
|
42
|
+
const openApiFile = myArgs[0];
|
43
|
+
const outputFile = myArgs[1];
|
44
|
+
const openapi = js_yaml_1.default.load(fs_1.default.readFileSync(openApiFile, 'utf8'));
|
45
|
+
if (openapi.components.schemas) {
|
46
|
+
const sortedComponentSchemas = {};
|
47
|
+
Object.keys(openapi.components.schemas)
|
48
|
+
.sort()
|
49
|
+
.forEach((key) => {
|
50
|
+
sortedComponentSchemas[key] = openapi.components.schemas[key];
|
51
|
+
});
|
52
|
+
openapi.components.schemas = sortedComponentSchemas;
|
53
|
+
}
|
54
|
+
if (openapi.components.parameters) {
|
55
|
+
const sortedComponentParameters = {};
|
56
|
+
Object.keys(openapi.components.parameters)
|
57
|
+
.sort()
|
58
|
+
.forEach((key) => {
|
59
|
+
sortedComponentParameters[key] = openapi.components.parameters[key];
|
60
|
+
});
|
61
|
+
openapi.components.parameters = sortedComponentParameters;
|
62
|
+
}
|
63
|
+
// Deleting unnecessary paths those are added as a workaround for the openapi-cli bundle issue
|
64
|
+
delete openapi.paths['/interface'];
|
65
|
+
fs_1.default.writeFileSync(outputFile, (0, openapi_core_1.stringifyYaml)(openapi, {
|
66
|
+
quotingType: '"',
|
67
|
+
forceQuotes: false
|
68
|
+
}));
|
69
|
+
console.log(`Refactored the specification in ${outputFile}`);
|
70
|
+
//# sourceMappingURL=openapi-refactor.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"openapi-refactor.js","sourceRoot":"","sources":["../../src/scripts/openapi-refactor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2BQ;;;AAER,wFAAwF;AACxF,4DAA4D;AAE5D,oDAAmB;AACnB,8DAA0B;AAC1B,wDAAqD;AAErD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACpC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IACxB,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAA;IAC5F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;AACD,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;AAC7B,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA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
|
|
1
1
|
{
|
2
2
|
"name": "@mojaloop/api-snippets",
|
3
|
-
"version": "17.
|
3
|
+
"version": "17.3.0",
|
4
4
|
"description": "Mojaloop API specification reusable snippets",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"types": "lib/index.d.ts",
|
@@ -8,17 +8,19 @@
|
|
8
8
|
"audit:fix": "npm audit fix",
|
9
9
|
"audit:check": "npx audit-ci --config ./audit-ci.jsonc",
|
10
10
|
"build": "npm run build:openapi; npm run build:dto; npm run build:schemas; tsc -p ./tsconfig.build.json",
|
11
|
-
"build:dto": "npm run build:dto:v1.0; npm run build:dto:v1.1; npm run build:dto:thirdparty; npm run build:dto:sdk-scheme-adapter;",
|
11
|
+
"build:dto": "npm run build:dto:v1.0; npm run build:dto:v1.1; npm run build:dto:v2.0; npm run build:dto:thirdparty; npm run build:dto:sdk-scheme-adapter;",
|
12
12
|
"build:schemas": "npm run build:schemas:sdk-scheme-adapter:backend; npm run build:schemas:sdk-scheme-adapter:outbound;",
|
13
13
|
"build:dto:v1.0": "openapi-typescript docs/fspiop-rest-v1.0-openapi3-snippets.yaml --output src/fspiop/v1_0/openapi.ts",
|
14
14
|
"build:dto:v1.1": "openapi-typescript docs/fspiop-rest-v1.1-openapi3-snippets.yaml --output src/fspiop/v1_1/openapi.ts",
|
15
|
+
"build:dto:v2.0": "openapi-typescript docs/fspiop-rest-v2.0-openapi3-snippets.yaml --output src/fspiop/v2_0/openapi.ts",
|
15
16
|
"build:dto:thirdparty": "openapi-typescript docs/thirdparty-openapi3-snippets.yaml --output src/thirdparty/openapi.ts",
|
16
17
|
"build:dto:sdk-scheme-adapter": "npm run build:dto:sdk-scheme-adapter:backend; npm run build:dto:sdk-scheme-adapter:outbound;",
|
17
18
|
"build:dto:sdk-scheme-adapter:backend": "openapi-typescript docs/sdk-scheme-adapter-backend-v2_0_0-openapi3-snippets.yaml --output src/sdk-scheme-adapter/v2_0_0/backend/openapi.ts",
|
18
19
|
"build:dto:sdk-scheme-adapter:outbound": "openapi-typescript docs/sdk-scheme-adapter-outbound-v2_0_0-openapi3-snippets.yaml --output src/sdk-scheme-adapter/v2_0_0/outbound/openapi.ts",
|
19
|
-
"build:openapi": "npm run build:v1.0; npm run build:v1.1; npm run build:thirdparty; npm run build:sdk-scheme-adapter:backend; npm run build:sdk-scheme-adapter:outbound;",
|
20
|
+
"build:openapi": "npm run build:v1.0; npm run build:v1.1; npm run build:refactor:fspiop:v1.1; npm run build:v2.0; npm run build:refactor:fspiop:v2.0; npm run build:thirdparty; npm run build:sdk-scheme-adapter:backend; npm run build:sdk-scheme-adapter:outbound;",
|
20
21
|
"build:v1.0": "openapi bundle --output docs/fspiop-rest-v1.0-openapi3-snippets.yaml --ext yaml fspiop/v1_0/openapi3/openapi.yaml && swagger-cli validate docs/fspiop-rest-v1.0-openapi3-snippets.yaml",
|
21
22
|
"build:v1.1": "openapi bundle --output docs/fspiop-rest-v1.1-openapi3-snippets.yaml --ext yaml fspiop/v1_1/openapi3/openapi.yaml && swagger-cli validate docs/fspiop-rest-v1.1-openapi3-snippets.yaml",
|
23
|
+
"build:v2.0": "openapi bundle --output docs/fspiop-rest-v2.0-openapi3-snippets.yaml --ext yaml fspiop/v2_0/openapi3/openapi.yaml && swagger-cli validate docs/fspiop-rest-v2.0-openapi3-snippets.yaml",
|
22
24
|
"build:thirdparty": "openapi bundle --output docs/thirdparty-openapi3-snippets.yaml --ext yaml thirdparty/v1_0/openapi3/openapi.yaml && swagger-cli validate docs/thirdparty-openapi3-snippets.yaml",
|
23
25
|
"build:thirdparty-dfsp": "swagger-cli bundle -o ./thirdparty/v1_0/openapi3/thirdparty-dfsp-api.yaml -t yaml ./thirdparty/v1_0/openapi3/thirdparty-dfsp-api.template.yaml",
|
24
26
|
"build:thirdparty-pisp": "swagger-cli bundle -o ./thirdparty/v1_0/openapi3/thirdparty-pisp-api.yaml -t yaml ./thirdparty/v1_0/openapi3/thirdparty-pisp-api.template.yaml",
|
@@ -26,6 +28,8 @@
|
|
26
28
|
"build:sdk-scheme-adapter:outbound": "openapi bundle --output docs/sdk-scheme-adapter-outbound-v2_0_0-openapi3-snippets.yaml --ext yaml sdk-scheme-adapter/v2_0_0/outbound/openapi.yaml && swagger-cli validate docs/sdk-scheme-adapter-outbound-v2_0_0-openapi3-snippets.yaml",
|
27
29
|
"build:schemas:sdk-scheme-adapter:backend": "npx ts-node --transpile-only src/scripts/json-schema-generator.ts docs/sdk-scheme-adapter-backend-v2_0_0-openapi3-snippets.yaml src/sdk-scheme-adapter/v2_0_0/backend",
|
28
30
|
"build:schemas:sdk-scheme-adapter:outbound": "npx ts-node --transpile-only src/scripts/json-schema-generator.ts docs/sdk-scheme-adapter-outbound-v2_0_0-openapi3-snippets.yaml src/sdk-scheme-adapter/v2_0_0/outbound",
|
31
|
+
"build:refactor:fspiop:v1.1": "npx ts-node --transpile-only src/scripts/openapi-refactor.ts docs/fspiop-rest-v1.1-openapi3-snippets.yaml docs/fspiop-rest-v1.1-openapi3-snippets.yaml",
|
32
|
+
"build:refactor:fspiop:v2.0": "npx ts-node --transpile-only src/scripts/openapi-refactor.ts docs/fspiop-rest-v2.0-openapi3-snippets.yaml docs/fspiop-rest-v2.0-openapi3-snippets.yaml",
|
29
33
|
"lint": "eslint --ext ts --ext js test src",
|
30
34
|
"lint:fix": "eslint --fix --ext ts --ext js test src",
|
31
35
|
"prepare": "husky install && npm run build",
|
@@ -34,7 +38,8 @@
|
|
34
38
|
"release": "standard-version --releaseCommitMessageFormat 'chore(release): {{currentTag}} [skip ci]'",
|
35
39
|
"snapshot": "standard-version --no-verify --skip.changelog --prerelease snapshot --releaseCommitMessageFormat 'chore(snapshot): {{currentTag}}'",
|
36
40
|
"test": "npm run test:unit",
|
37
|
-
"test:unit": "jest --testMatch '**/test/dto/*.(test|spec).ts'"
|
41
|
+
"test:unit": "jest --testMatch '**/test/dto/*.(test|spec).ts'",
|
42
|
+
"dev:watch": "browser-sync start --server 'docs' --cwd 'docs' --files '*.yaml'"
|
38
43
|
},
|
39
44
|
"lint-staged": {
|
40
45
|
"*.{js,ts}": "eslint --cache --fix"
|
@@ -59,12 +64,13 @@
|
|
59
64
|
"license": "Apache-2.0",
|
60
65
|
"dependencies": {
|
61
66
|
"@apidevtools/json-schema-ref-parser": "^9.1.2",
|
62
|
-
"
|
67
|
+
"@redocly/openapi-core": "^1.5.0",
|
68
|
+
"commander": "^11.1.0",
|
63
69
|
"jest-ts-auto-mock": "^2.1.0",
|
64
70
|
"js-yaml": "^4.1.0",
|
65
71
|
"json-refs": "^3.0.15",
|
66
72
|
"openapi-types": "^12.1.3",
|
67
|
-
"openapi-typescript": "^6.
|
73
|
+
"openapi-typescript": "^6.7.2",
|
68
74
|
"ts-auto-mock": "^3.7.1"
|
69
75
|
},
|
70
76
|
"overrides": {
|
@@ -72,37 +78,39 @@
|
|
72
78
|
"@types/responselike": "^1.0.0"
|
73
79
|
},
|
74
80
|
"devDependencies": {
|
75
|
-
"@commitlint/cli": "^
|
76
|
-
"@commitlint/config-conventional": "^
|
77
|
-
"@redocly/
|
78
|
-
"@types/jest": "^29.5.
|
79
|
-
"@
|
80
|
-
"@typescript-eslint/
|
81
|
+
"@commitlint/cli": "^18.4.3",
|
82
|
+
"@commitlint/config-conventional": "^18.4.3",
|
83
|
+
"@redocly/cli": "^1.5.0",
|
84
|
+
"@types/jest": "^29.5.10",
|
85
|
+
"@types/js-yaml": "^4.0.9",
|
86
|
+
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
87
|
+
"@typescript-eslint/parser": "^6.13.2",
|
81
88
|
"audit-ci": "^6.6.1",
|
89
|
+
"browser-sync": "^2.29.3",
|
82
90
|
"diff": "^5.1.0",
|
83
|
-
"eslint": "^8.
|
84
|
-
"eslint-config-prettier": "^9.
|
91
|
+
"eslint": "^8.55.0",
|
92
|
+
"eslint-config-prettier": "^9.1.0",
|
85
93
|
"eslint-config-standard": "^17.1.0",
|
86
|
-
"eslint-import-resolver-typescript": "^3.6.
|
94
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
87
95
|
"eslint-plugin-cucumber": "^2.0.0",
|
88
|
-
"eslint-plugin-import": "^2.
|
96
|
+
"eslint-plugin-import": "^2.29.0",
|
89
97
|
"eslint-plugin-node": "^11.1.0",
|
90
|
-
"eslint-plugin-prettier": "^5.0.
|
98
|
+
"eslint-plugin-prettier": "^5.0.1",
|
91
99
|
"eslint-plugin-promise": "^6.1.1",
|
92
100
|
"eslint-plugin-standard": "^5.0.0",
|
93
101
|
"husky": "8.0.3",
|
94
102
|
"jest": "^29.7.0",
|
95
103
|
"jest-junit": "^16.0.0",
|
96
|
-
"lint-staged": "^
|
97
|
-
"npm-check-updates": "^16.14.
|
98
|
-
"prettier": "^3.0
|
104
|
+
"lint-staged": "^15.2.0",
|
105
|
+
"npm-check-updates": "^16.14.11",
|
106
|
+
"prettier": "^3.1.0",
|
99
107
|
"standard-version": "^9.5.0",
|
100
108
|
"swagger-cli": "^4.0.4",
|
101
109
|
"ts-jest": "^29.1.1",
|
102
110
|
"ts-node": "^10.9.1",
|
103
111
|
"ts-patch": "^3.0.2",
|
104
112
|
"tslib": "^2.6.2",
|
105
|
-
"typescript": "^5.
|
113
|
+
"typescript": "^5.3.2"
|
106
114
|
},
|
107
115
|
"publishConfig": {
|
108
116
|
"registry": "https://registry.npmjs.org/"
|