serverless-openapi-documenter 0.0.124-beta.1 → 0.1.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/test.js DELETED
@@ -1,204 +0,0 @@
1
- const $RefParser = require("@apidevtools/json-schema-ref-parser");
2
-
3
- const schema = {
4
- $id: "http://schemas.aat.org.uk/build/ProgrammeRegistration.json",
5
- $schema: "http://json-schema.org/draft-04/schema#",
6
- title: "ProgrammeRegistration",
7
- description: "Programme registration schema",
8
- required: ["programmeRegistrationDetail"],
9
- additionalProperties: false,
10
- type: "object",
11
- properties: {
12
- programmeRegistrationDetail: {
13
- $ref: "#/definitions/ProgrammeRegistrationType",
14
- },
15
- programmeRegistrationQuestionResponse: {
16
- anyOf: [
17
- { type: "null" },
18
- {
19
- type: "object",
20
- additionalProperties: false,
21
- properties: {
22
- questions: {
23
- type: "array",
24
- items: { $ref: "#/definitions/QuestionResponse" },
25
- minItems: 1,
26
- maxItems: 30,
27
- uniqueItems: true,
28
- },
29
- },
30
- },
31
- ],
32
- },
33
- autoOrderCreate: {
34
- anyOf: [{ type: "boolean", default: false }, { type: "null" }],
35
- },
36
- },
37
- version: "1.1.1",
38
- definitions: {
39
- ProgrammeRegistrationType: {
40
- title: "ProgrammeRegistrationType",
41
- description: "programme registration type",
42
- type: "object",
43
- additionalProperties: false,
44
- required: [
45
- "programmeRegistrationId",
46
- "contactId",
47
- "trainingProviderOrganisationId",
48
- "qualificationId",
49
- "startingLevel",
50
- ],
51
- properties: {
52
- programmeRegistrationId: { $ref: "#/definitions/UUID" },
53
- programmeRegistrationCRMId: { $ref: "#/definitions/UUID" },
54
- contactId: { $ref: "#/definitions/UUID" },
55
- trainingProviderOrganisationId: { $ref: "#/definitions/UUID" },
56
- qualificationId: { $ref: "#/definitions/UUID" },
57
- qualificationLocalCode: {
58
- anyOf: [{ type: "null" }, { type: "string" }],
59
- },
60
- startingLevel: { $ref: "#/definitions/UUID" },
61
- expectedEndLevel: {
62
- anyOf: [{ $ref: "#/definitions/UUID" }, { type: "null" }],
63
- },
64
- currentLevel: {
65
- anyOf: [{ $ref: "#/definitions/UUID" }, { type: "null" }],
66
- },
67
- registrationDate: {
68
- anyOf: [{ $ref: "#/definitions/AATDate" }, { type: "null" }],
69
- },
70
- fundingType: {
71
- anyOf: [
72
- { type: "null" },
73
- { $ref: "#/definitions/ProgrammeRegistrationFundingType" },
74
- ],
75
- },
76
- endDate: {
77
- anyOf: [{ type: "null" }, { $ref: "#/definitions/AATDate" }],
78
- },
79
- fundingTypeMembershipFees: {
80
- anyOf: [
81
- { type: "null" },
82
- { $ref: "#/definitions/ProgrammeRegistrationFundingType" },
83
- ],
84
- },
85
- apprenticeship: { type: "boolean", default: false },
86
- apprenticeshipStartDate: {
87
- anyOf: [{ $ref: "#/definitions/AATDate" }, { type: "null" }],
88
- },
89
- fullTime: { type: "boolean", default: false },
90
- distanceLearning: { type: "boolean", default: false },
91
- payingOrganisationId: {
92
- anyOf: [{ $ref: "#/definitions/UUID" }, { type: "null" }],
93
- },
94
- employmentId: {
95
- anyOf: [{ $ref: "#/definitions/UUID" }, { type: "null" }],
96
- },
97
- poNumber: {
98
- anyOf: [{ type: "string", maxLength: 50 }, { type: "null" }],
99
- },
100
- poRequester: {
101
- anyOf: [{ type: "string", maxLength: 50 }, { type: "null" }],
102
- },
103
- assessmentPoNumber: {
104
- anyOf: [{ type: "string", maxLength: 50 }, { type: "null" }],
105
- },
106
- smartEPAId: {
107
- anyOf: [{ $ref: "#/definitions/UUID" }, { type: "null" }],
108
- },
109
- autoOrderCreate: {
110
- anyOf: [{ type: "boolean", default: false }, { type: "null" }],
111
- },
112
- membershipApplicationId: {
113
- anyOf: [{ $ref: "#/definitions/UUID" }, { type: "null" }],
114
- },
115
- gatewayDate: {
116
- anyOf: [{ $ref: "#/definitions/AATDate" }, { type: "null" }],
117
- },
118
- registrationStatus: {
119
- anyOf: [{ type: "null" }, { type: "string" }],
120
- },
121
- registrationStatusDate: {
122
- anyOf: [{ $ref: "#/definitions/AATDate" }, { type: "null" }],
123
- },
124
- givenName: { anyOf: [{ type: "null" }, { type: "string" }] },
125
- familyName: { anyOf: [{ type: "null" }, { type: "string" }] },
126
- memberId: { anyOf: [{ type: "null" }, { type: "string" }] },
127
- birthDate: {
128
- anyOf: [{ $ref: "#/definitions/AATDate" }, { type: "null" }],
129
- },
130
- epaRegisteredOn: {
131
- anyOf: [
132
- { type: "null" },
133
- {
134
- type: "boolean",
135
- description:
136
- "Indicates the user is studying the associated apprenticeship",
137
- },
138
- ],
139
- },
140
- },
141
- },
142
- QuestionResponse: {
143
- title: "QuestionResponse",
144
- description: "response to a question",
145
- type: "object",
146
- additionalProperties: false,
147
- required: ["questionId", "responseId", "response"],
148
- properties: {
149
- responseId: { $ref: "#/definitions/UUID" },
150
- questionId: { $ref: "#/definitions/UUID" },
151
- response: {
152
- type: "object",
153
- anyOf: [
154
- { text: { type: "string" } },
155
- { multiLineText: { type: "string" } },
156
- { currency: { type: "number" } },
157
- { date: { $ref: "#/source/base/AATDate.json" } },
158
- { decimal: { type: "number" } },
159
- { optionSet: { type: "string" } },
160
- { wholeNumber: { type: "integer" } },
161
- ],
162
- },
163
- },
164
- },
165
- UUID: {
166
- title: "UUID",
167
- description: "Universally Unique Identifier (all lowercase)",
168
- type: "string",
169
- pattern: "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
170
- },
171
- AATDate: {
172
- title: "AATDate",
173
- description: "AAT Date formatted",
174
- type: "string",
175
- examples: ["2014-07-17T10:02:21Z"],
176
- },
177
- ProgrammeRegistrationFundingType: {
178
- title: "ProgrammeRegistrationFundingType",
179
- description: "funding types for programme registrations",
180
- type: "string",
181
- enum: [
182
- "Employer",
183
- "Student",
184
- "Training Provider",
185
- "AAT(SA)",
186
- "AAT NZICA",
187
- "Unknown",
188
- "Government",
189
- ],
190
- },
191
- },
192
- };
193
-
194
- const main = async () => {
195
- let deReferencedSchema = await $RefParser
196
- .dereference("schemas.aat.org.uk/build/ProgrammeRegistration.json")
197
- .catch((err) => {
198
- throw err;
199
- });
200
-
201
- console.log(deReferencedSchema);
202
- };
203
-
204
- main().catch((err) => console.error(err));
package/test2.js DELETED
@@ -1,146 +0,0 @@
1
- const $RefParser = require("@apidevtools/json-schema-ref-parser");
2
-
3
- const schema = {
4
- $id: "http://schemas.aat.org.uk/build/TrainingProviderApprovalDetail.json",
5
- $schema: "http://json-schema.org/draft-04/schema#",
6
- title: "TrainingProviderApprovalDetail",
7
- description: "Training Provider Approval",
8
- required: ["approval"],
9
- additionalProperties: false,
10
- type: "object",
11
- properties: {
12
- abc: { type: "string" },
13
- // approval: { $ref: "#/definitions/TrainingProviderApproval" },
14
- // approvalQuestionResponse: {
15
- // anyOf: [
16
- // {
17
- // type: "object",
18
- // properties: {
19
- // questions: {
20
- // type: "array",
21
- // items: { $ref: "#/definitions/QuestionResponse" },
22
- // minItems: 1,
23
- // maxItems: 30,
24
- // uniqueItems: true,
25
- // },
26
- // },
27
- // },
28
- // { type: "null" },
29
- // ],
30
- // },
31
- },
32
- version: "1.1.1",
33
- definitions: {
34
- // TrainingProviderApproval: {
35
- // title: "TrainingProviderApproval",
36
- // description: "Training Provider Approval",
37
- // required: [
38
- // "TPapprovalId",
39
- // "approvalCRMId",
40
- // "qualificationId",
41
- // "status",
42
- // "qualificationName",
43
- // "organisationId",
44
- // ],
45
- // additionalProperties: false,
46
- // type: "object",
47
- // properties: {
48
- // TPapprovalId: { $ref: "#/definitions/UUID" },
49
- // TPapprovalCRMId: {
50
- // anyOf: [{ $ref: "#/definitions/UUID" }, { type: "null" }],
51
- // },
52
- // approvalCRMId: { $ref: "#/definitions/UUID" },
53
- // organisationId: { $ref: "#/definitions/UUID" },
54
- // qualificationName: { type: "string", maxLength: 100 },
55
- // qualificationShortName: {
56
- // anyOf: [{ type: "string", maxLength: 100 }, { type: "null" }],
57
- // },
58
- // localCode: {
59
- // anyOf: [{ type: "string", maxLength: 20 }, { type: "null" }],
60
- // },
61
- // aatId: { anyOf: [{ type: "number" }, { type: "null" }] },
62
- // qualificationId: { $ref: "#/definitions/UUID" },
63
- // status: {
64
- // type: "string",
65
- // enum: [
66
- // "Sales Prospect",
67
- // "EOI Sent",
68
- // "EOI Received",
69
- // "EOI More Information Requested",
70
- // "EOI Declined",
71
- // "EOI Closed",
72
- // "Application On Hold By TP",
73
- // "Application Pack Sent",
74
- // "Application Pending",
75
- // "Approval Visit Scheduled",
76
- // "Approval Visit Action Plan",
77
- // "Application Closed",
78
- // "Application Withdrawn",
79
- // "Approved",
80
- // "Conditionally Approved",
81
- // "Referred to Conduct & Compliance",
82
- // "Rejected",
83
- // "Inactive",
84
- // "Withdrawn",
85
- // ],
86
- // },
87
- // statusDate: {
88
- // anyOf: [{ $ref: "#/definitions/AATDate" }, { type: "null" }],
89
- // },
90
- // fromDate: {
91
- // anyOf: [{ $ref: "#/definitions/AATDate" }, { type: "null" }],
92
- // },
93
- // untilDate: {
94
- // anyOf: [{ $ref: "#/definitions/AATDate" }, { type: "null" }],
95
- // },
96
- // },
97
- // },
98
- QuestionResponse: {
99
- title: "QuestionResponse",
100
- description: "response to a question",
101
- type: "object",
102
- additionalProperties: false,
103
- required: ["questionId", "responseId", "response"],
104
- properties: {
105
- responseId: { $ref: "#/definitions/UUID" },
106
- questionId: { $ref: "#/definitions/UUID" },
107
- response: {
108
- type: "object",
109
- anyOf: [
110
- { text: { type: "string" } },
111
- { multiLineText: { type: "string" } },
112
- { currency: { type: "number" } },
113
- { date: { $ref: "#/source/base/AATDate.json" } },
114
- { decimal: { type: "number" } },
115
- { optionSet: { type: "string" } },
116
- { wholeNumber: { type: "integer" } },
117
- ],
118
- },
119
- },
120
- },
121
- UUID: {
122
- title: "UUID",
123
- description: "Universally Unique Identifier (all lowercase)",
124
- type: "string",
125
- pattern: "[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}",
126
- },
127
- AATDate: {
128
- title: "AATDate",
129
- description: "AAT Date formatted",
130
- type: "string",
131
- examples: ["2014-07-17T10:02:21Z"],
132
- },
133
- },
134
- };
135
-
136
- const schema2 = { type: "object", properties: { a: { type: "string" } } };
137
-
138
- const main = async () => {
139
- const bundledSchema = await $RefParser.bundle(schema).catch((err) => {
140
- throw err;
141
- });
142
-
143
- console.log(bundledSchema);
144
- };
145
-
146
- main().catch((err) => console.error(err));
package/test3.js DELETED
@@ -1,29 +0,0 @@
1
- const {
2
- Config,
3
- lintFromString,
4
- stringifyYaml,
5
- createConfig,
6
- } = require("@redocly/openapi-core");
7
-
8
- const openAPI = require("./openapi.json");
9
-
10
- const main = async () => {
11
- const config = await createConfig({
12
- apis: {},
13
- rules: this.REDOCLY_RULES,
14
- });
15
-
16
- const apiDesc = stringifyYaml(openAPI);
17
-
18
- const output = await lintFromString({
19
- source: apiDesc,
20
- config: config,
21
- }).catch((err) => {
22
- console.error(err);
23
- throw err;
24
- });
25
-
26
- console.log(output);
27
- };
28
-
29
- main().catch((err) => console.error(err));