diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/examples/apiApprovedLeadEvent.yml b/Tests/Fixtures/acme/birch-catalog/analytics/examples/apiApprovedLeadEvent.yml new file mode 100644 index 0000000..6957b72 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/examples/apiApprovedLeadEvent.yml @@ -0,0 +1,11 @@ +summary: API approved +value: + { + "id": "356a192b7913b04c54574d18c28d46e6395428ab", + "leadUuid": "39afdb4a-ef26-42ed-a313-e28288f95099", + "leadCreatedAt": "2019-10-10T20:42:06Z", + "eventType": "apiApproved", + "eventCreatedAt": "2019-10-10T20:44:28Z", + "financialInstitutionUuid": "da14e06b-0866-4f02-a3b2-9443501b25b9", + "financialInstitutionName": "LendingClub" + } \ No newline at end of file diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/examples/offerClickedLeadEvent.yml b/Tests/Fixtures/acme/birch-catalog/analytics/examples/offerClickedLeadEvent.yml new file mode 100644 index 0000000..bc3fbab --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/examples/offerClickedLeadEvent.yml @@ -0,0 +1,13 @@ +summary: offer clicked +value: + { + "id": "da4b9237bacccdf19c0760cab7aec4a8359010b0", + "leadUuid": "4bbb25a6-6fcf-4ed3-88f9-6daacb0f8b33", + "leadCreatedAt": "2019-09-21T11:24:45Z", + "eventType": "offerClicked", + "eventCreatedAt": "2019-09-22T17:44:22Z", + "financialInstitutionUuid": "da14e06b-0866-4f02-a3b2-9443501b25b9", + "financialInstitutionName": "OpenSky®", + "offerUuid": "5243140e-0a98-4301-9b6b-1283a52b857b", + "offerName": "OpenSky® Secured Visa® Credit Card" + } diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/examples/revenueSummaryResponse.yml b/Tests/Fixtures/acme/birch-catalog/analytics/examples/revenueSummaryResponse.yml new file mode 100644 index 0000000..3a53e31 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/examples/revenueSummaryResponse.yml @@ -0,0 +1,24 @@ +summary: Aggregated monthly revenue summary +value: + [ + { + "leadCreatedAtMin": "2020-01-01", + "leadCreatedAtMax": "2020-02-01", + "leadCount": 500, + "submittedApplicatonCount": 500, + "preApprovedApplicationCount": 300, + "offerClickCount": 100, + "fundedCount": 90, + "totalAttributedRevenue": 3000 + }, + { + "leadCreatedAtMin": "2020-02-01", + "leadCreatedAtMax": "2020-03-01", + "leadCount": 600, + "submittedApplicatonCount": 400, + "preApprovedApplicationCount": 200, + "offerClickCount": 100, + "fundedCount": 70, + "totalAttributedRevenue": 2000 + } + ] diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/schemas/eventType.yml b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/eventType.yml new file mode 100644 index 0000000..827d363 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/eventType.yml @@ -0,0 +1,13 @@ +type: string +enum: + - leadCreated + - appSubmitted + - apiApproved + - apiRejected + - offerClicked + - applied + - approved + - listed + - opened + - funded + - conversion diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/schemas/leadEvent.yml b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/leadEvent.yml new file mode 100644 index 0000000..e4904cf --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/leadEvent.yml @@ -0,0 +1,78 @@ +type: object +required: + - id + - leadUuid + - leadCreatedAt + - eventType + - eventCreatedAt +properties: + id: + type: string + description: > + A unique identifier for the event. + leadUuid: + type: string + format: uuid + description: > + A unique identifier for the associated lead. + leadCreatedAt: + type: string + format: date-time + description: > + The time that the associated lead was created. + eventType: + $ref: ./eventType.yml + eventCreatedAt: + type: string + format: date-time + description: > + The time that the event occurred. + eventPayout: + type: integer + format: int32 + description: > + The payout associated with the event, in cents. Only present for some + events. + eventDollarAmount: + type: integer + format: int32 + description: > + The dollar amount associated with event, in cents. Only present for some + events. + financialInstitutionUuid: + type: string + format: uuid + description: > + A unique identifier for the associated financial institution. Only present + for event types associated with financial institutions. + financialInstitutionName: + type: string + description: > + The name of the associated financial institution. This value is subject to + change, so `financialInstitutionUuid` should be used for grouping. Only + present for event types associated with financial institutions. + rateTableUuid: + type: string + format: uuid + description: > + A unique identifier for the associated rate table. Only present for event + types associated with offers. + offerUuid: + type: string + format: uuid + description: > + A unique identifier for the associated offer. Only present for event types + associated with offers. + offerName: + type: string + description: > + A unique identifier for the associated offer. This value is subject to + change, so `offerUuid` should be used for grouping. Only present for event + types associated with offers. + offerProductType: + $ref: ./offerProductType.yml + description: > + The product type for the associated offer. Only present for event + types associated with offers. + offerFirmness: + $ref: ./offerFirmness.yml diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/schemas/offerFirmness.yml b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/offerFirmness.yml new file mode 100644 index 0000000..c5f7e93 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/offerFirmness.yml @@ -0,0 +1,8 @@ +type: string +description: > + The firmness of the associated offer. Only present for event types + associated with offers. +enum: + - preSelected + - preQualified + - preApproved diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/schemas/offerProductType.yml b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/offerProductType.yml new file mode 100644 index 0000000..9a6d952 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/offerProductType.yml @@ -0,0 +1,6 @@ +type: string +enum: + - loan + - savings + - creditCard + - special diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/schemas/revenueSummary.yml b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/revenueSummary.yml new file mode 100644 index 0000000..9d37ef1 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/revenueSummary.yml @@ -0,0 +1,108 @@ +type: object +required: + - leadCreatedAtMin + - leadCreatedAtMax + - leadCount + - submittedApplicationCount + - preApprovedApplicationCount + - offerClickCount + - fundedCount +properties: + leadCreatedAtMin: + title: Date + type: string + format: date + description: > + The beginning day of the bucket, in the UTC timezone. If data is aggregated by week, + this defaults to the Monday of each week. If aggregated by month, instead this defaults to the + first of each month. + leadCreatedAtMax: + title: Date + type: string + format: date + description: > + The beginning day of the subsequent bucket. By default, this is the day after the leadCreatedAtMin. + If data was requested to be aggregated by week, instead this is 7 days after the leadCreatedAtMin. + If instead by month, this is the first day of the next month of this bucket. + clientTagValue: + title: Client Tag Value + type: string + description: > + The actual value of a client tag key-value pair, used for aggregation. + Only present if a client tag is specified in the query. + creditRating: + title: Credit Rating + type: string + description: > + One of (Fair, Poor, Good, Excellent). + Only present if credit rating is specified as a group by clause + loanPurpose: + title: Loan Purpose + type: string + description: > + Self-reported purpose for a lead for applying to this loan, e.g. taxes, student loan refinancing. + Only present if loan purpose is specified as a group by clause. + referralUrl: + description: > + Url from which a lead was referred. This has only the host, as other url parameters such as utm + will be stripped out. + Only present if referral Url is requested as a group by clause. + leadCount: + title: Leads + type: integer + format: int32 + description: > + Sum of all leads for the queried partner and time period, for the loan vertical. + If booked revenue was requested, instead this column indicates the number of leads paid out to the queried partner. + submittedApplicationCount: + title: Submitted Applications + type: integer + format: int32 + description: > + Number of leads from the queried partner that submitted an application. + If booked revenue was requested, this number is restricted to just leads that were paid out for. + preApprovedApplicationCount: + title: Approved Count + type: integer + format: int32 + description: > + Number of pre-approved applications from the queried partner. + If booked revenue was requested, this number is restricted to just leads that were paid out for. + offerClickCount: + title: Offer Click Count + type: integer + format: int32 + description: > + Number of leads that clicked on at least one offer, after pre-approval. + If booked revenue was requested, this number is restricted to just leads that were paid out for. + fundedCount: + title: Funded Count + type: integer + format: int32 + description: > + Number of leads funded by an external loan provider. + If booked revenue was requested, this number is restricted to just leads that were paid out for. + totalBookedRevenue: + title: Total Booked Revenue + type: integer + format: int32 + description: > + Total revenue to the supply partner in cents (i.e. $1.23 is reported as 123) for a particular bucket. + Booked revenue is considered to be revenue that has actually been paid out. + This column is only present in the response if booked revenue was requested. + totalAttributedRevenue: + title: Total Attributed Revenue + type: integer + format: int32 + description: > + Total revenue to the supply partner in cents (i.e. $1.23 is reported as 123) for a particular bucket. + Attributed revenue is considered to be revenue that is projected based on a conversion event, + but may not necessarily have been paid out. + totalUnattributedRevenue: + title: Total Unattributed Revenue + type: integer + format: int32 + description: > + Total booked revenue to the supply partner in cents (i.e. $1.23 is reported as 123) for a particular bucket. + Unattributed revenue is revenue that is paid out but can not be attributed to any lead, and therefore funnel + statistics on unattributed revenue behavior would not apply. \ No newline at end of file diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/schemas/revenueSummaryGrouping.yml b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/revenueSummaryGrouping.yml new file mode 100644 index 0000000..9958848 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/revenueSummaryGrouping.yml @@ -0,0 +1,8 @@ +type: string +enum: + - day + - week + - month + - creditRating + - loanPurpose + - referralUrl diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/schemas/revenueType.yml b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/revenueType.yml new file mode 100644 index 0000000..3f6b1c0 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/revenueType.yml @@ -0,0 +1,4 @@ +type: string +enum: + - attributed + - booked diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/schemas/staticOfferAttributionSummary.yml b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/staticOfferAttributionSummary.yml new file mode 100644 index 0000000..52b9688 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/staticOfferAttributionSummary.yml @@ -0,0 +1,36 @@ +type: object +required: + - offerId + - staticOfferId + - offerClickCount + - loanRevenue + - savingsRevenue + - creditCardRevenue + - otherRevenue + - revenue +properties: + offerId: + type: integer + format: int32 + staticOfferId: + type: integer + format: int32 + offerClickCount: + type: integer + format: int32 + loanRevenue: + type: integer + format: int64 + savingsRevenue: + type: integer + format: int64 + creditCardRevenue: + type: integer + format: int64 + otherRevenue: + type: integer + format: int64 + revenue: + type: integer + format: int64 + description: Total revenue attributed to the given static offer diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/schemas/staticOfferAttributionSummaryRequest.yml b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/staticOfferAttributionSummaryRequest.yml new file mode 100644 index 0000000..415924f --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/schemas/staticOfferAttributionSummaryRequest.yml @@ -0,0 +1,8 @@ +type: object +properties: + staticOfferIds: + title: Static Offer IDs + type: array + items: + type: integer + format: int32 diff --git a/Tests/Fixtures/acme/birch-catalog/analytics/spec.yml b/Tests/Fixtures/acme/birch-catalog/analytics/spec.yml new file mode 100644 index 0000000..692c7bb --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/analytics/spec.yml @@ -0,0 +1,84 @@ +openapi: 3.0.3 +info: + title: analytics + description: | + Querying for data and making sense of it + version: 1.0.0 + contact: + name: Knowledge Team + url: >- + https://example.com/docs/api-team +servers: + - url: 'https://api.example.com/analytics' + description: Prod + - url: 'https://dev-api.example.com/analytics' + description: Dev +components: + x-lint-skip: + - inline-schema-is-scalar + securitySchemes: + oauth: + type: oauth2 + flows: + clientCredentials: + tokenUrl: /auth/accessTokens + scopes: + 'analytics:report:read': Allows read access to analytics reporting resources + 'analytics:report:readAll': Allows read access to all analytics reporting resources + 'analytics:revenue:read': Allows read access to analytics revenue resources + 'analytics:revenue:readAll': Allows read access to all analytics revenue resources + schemas: + ApiError: + $ref: ../core/schemas/apiError.yml + EventType: + $ref: ./schemas/eventType.yml + LeadEvent: + $ref: ./schemas/leadEvent.yml + OfferProductType: + $ref: ./schemas/offerProductType.yml + RevenueSummary: + $ref: ./schemas/revenueSummary.yml + StaticOfferAttributionSummary: + $ref: ./schemas/staticOfferAttributionSummary.yml + StaticOfferAttributionSummaryRequest: + $ref: ./schemas/staticOfferAttributionSummaryRequest.yml +tags: + - name: Analytics +paths: + /staticOfferAttributionSummaries: + post: + summary: Retrieve attribution summaries for a list of unique static offers + tags: + - Analytics + operationId: StaticOfferAttributionSummariesController.getViaPost + requestBody: + content: + application/json: + schema: + $ref: ./schemas/staticOfferAttributionSummaryRequest.yml + responses: + '200': + description: Attribution summaries retrieved successfully + content: + application/json: + schema: + $ref: ./schemas/staticOfferAttributionSummary.yml + '400': + description: Bad Request + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + '401': + description: Not authorized + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + examples: + missingAccessToken: + $ref: ../core/examples/error/missingAccessToken.yml diff --git a/Tests/Fixtures/acme/birch-catalog/approval-probability/schemas/approvalProbabilityCalculation.yml b/Tests/Fixtures/acme/birch-catalog/approval-probability/schemas/approvalProbabilityCalculation.yml new file mode 100644 index 0000000..0fcdea4 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/approval-probability/schemas/approvalProbabilityCalculation.yml @@ -0,0 +1,86 @@ +type: object +required: + - uuid + - productType + - identityHash + - result + - createdAt + - createdBy +properties: + uuid: + type: string + format: uuid + readOnly: true + description: | + A unique identifier for the caclulation. + productType: + type: string + description: | + The product type for the calculation. + identityHash: + type: string + writeOnly: true + description: | + A SHA-256 hash that is unique to the user, based upon PII. The input data + to the hash much be one of the following: + - SSN, email + - SSN, phone number + - SSN, email, phone number + + To make the hash, concatenate these attributes together produce the + SHA-256 hash. E.g.: + ``` + sha256(concat(user.ssn, user.email, user.phoneNumber)) + ``` + + If any attribute is missing, or the attributes are not in the specified + order, any potential offer match will fail. + state: + $ref: ../../core/schemas/state-lead.yml + providedCreditRating: + $ref: ../../lead/schemas/providedCreditRating.yml + annualIncome: + type: integer + format: int32 + minimum: 0 + employmentStatus: + $ref: ../../lead/schemas/employmentStatus.yml + result: + readOnly: true + allOf: + - $ref: ./result.yml + approvalProbability: + type: integer + format: int32 + minimum: 1 + maximum: 100 + readOnly: true + description: | + The likelihood of the specified identity being pre-approved for an offer + for the specified `productType`, expressed as a percentage. + + A value of `100` indicates that pre-approved offers exist. In this case, + `rateTableUuid` will be defined. + + If the `result` is `inconclusive`, then this will not be + specified. + rateTableUuid: + type: string + format: uuid + readOnly: true + description: | + The UUID of a rate table with existing pre-approved offers + for the specifed identity. Available if and only if the + value of `approvalProbability` is `100`. + createdAt: + type: string + format: date-time + readOnly: true + description: | + When the calculation was performed. + createdBy: + type: string + format: uuid + readOnly: true + description: | + The UUID of the access token that was used to request the calculation. diff --git a/Tests/Fixtures/acme/birch-catalog/approval-probability/schemas/identityHash.yml b/Tests/Fixtures/acme/birch-catalog/approval-probability/schemas/identityHash.yml new file mode 100644 index 0000000..757458e --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/approval-probability/schemas/identityHash.yml @@ -0,0 +1,87 @@ +type: object +required: + - id + - leadUuid + - leadUpdatedAt + - createdAt + - createdBy +properties: + id: + type: integer + format: int64 + readOnly: true + description: | + A unique, internal identifier for this resource. + leadUuid: + type: string + format: uuid + email: + type: string + writeOnly: true + ssn: + type: string + writeOnly: true + phone: + type: string + writeOnly: true + dateOfBirth: + type: string + format: date + writeOnly: true + ssnEmailHash: + type: string + readOnly: true + ssnPhoneHash: + type: string + readOnly: true + ssnPhoneEmailHash: + type: string + readOnly: true + lastFourSsnEmailHash: + type: string + readOnly: true + lastFourSsnPhoneHash: + type: string + readOnly: true + lastFourSsnPhoneEmailHash: + type: string + readOnly: true + phoneEmailHash: + type: string + readOnly: true + phoneDobHash: + type: string + readOnly: true + phoneEmailDobHash: + type: string + readOnly: true + emailHash: + type: string + readOnly: true + leadUpdatedAt: + type: string + format: date-time + createdAt: + type: string + format: date-time + readOnly: true + description: | + When the resource was created. + createdBy: + type: string + format: uuid + readOnly: true + description: | + The UUID of the access token that was used to create this resource. + deletedAt: + type: string + format: date-time + readOnly: true + description: | + When the resource was deleted. + deletedBy: + type: string + format: uuid + readOnly: true + description: | + The UUID of the access token that was used to delete this resource. diff --git a/Tests/Fixtures/acme/birch-catalog/approval-probability/schemas/result.yml b/Tests/Fixtures/acme/birch-catalog/approval-probability/schemas/result.yml new file mode 100644 index 0000000..17eb072 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/approval-probability/schemas/result.yml @@ -0,0 +1,10 @@ +type: string +enum: + - successful + - inconclusive +description: | + The result of the calculation. + + If this value is `successful`, then `approvalProbability` will be + specified. If `inconclusive` then we didn't have enough data to + perform the calculation, and `approvalProbability` will not be specified. diff --git a/Tests/Fixtures/acme/birch-catalog/approval-probability/spec.yml b/Tests/Fixtures/acme/birch-catalog/approval-probability/spec.yml new file mode 100644 index 0000000..16ed072 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/approval-probability/spec.yml @@ -0,0 +1,307 @@ +openapi: 3.0.3 +info: + title: approval-probability + description: | + Predicts the probability of pre-approval for a user based upon an identity + hash + version: 1.0.0 + contact: + name: API Team + url: >- + https://example.com/docs/api-team +servers: + - url: 'https://api.example.com/approvalProbability' + description: Prod + - url: 'https://dev-api.example.com/approvalProbability' + description: Dev +components: + securitySchemes: + oauth: + type: oauth2 + flows: + clientCredentials: + tokenUrl: /auth/accessTokens + scopes: + 'approval-probability:read': Allows read access to approval-probability resources + 'approval-probability:write': Allows write access to approval-probability svc-finance resources + schemas: + ApprovalProbabilityCalculation: + $ref: ./schemas/approvalProbabilityCalculation.yml + EmploymentStatus: + $ref: ../lead/schemas/employmentStatus.yml + ApiError: + $ref: ../core/schemas/apiError.yml + ProvidedCreditRating: + $ref: ../lead/schemas/providedCreditRating.yml + Result: + $ref: ./schemas/result.yml + State: + $ref: ../core/schemas/state-lead.yml + IdentityHash: + $ref: ./schemas/identityHash.yml +tags: + - name: Approval Probability +paths: + /approvalProbabilityCalculations: + post: + summary: Calculate approval probability for a user + description: | + Caclulate the probability of a user getting a pre-approved offer for a + particular product type. + + Caclulations are based upon either an irreversible, PII-based identity + hash or non-PII data about the user, or both. As a result, user consent + is not required to run the calculation. + + If an identity hash is specified, it's possible that the approval + probability will be calculated to be 100%. This indicates that there are + active offers for the user, for specified product type. If this is the + case, a UUID for a rate table containing those offers will be returned. + tags: + - Approval Probability + operationId: createApprovalProbabilityCalculation + requestBody: + content: + application/json: + schema: + $ref: ./schemas/approvalProbabilityCalculation.yml + responses: + '201': + description: Approval probability calculated successfully + content: + application/json: + schema: + $ref: ./schemas/approvalProbabilityCalculation.yml + '401': + description: Not authorized + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + examples: + missingAccessToken: + $ref: ../core/examples/error/missingAccessToken.yml + '422': + description: Invalid request + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + examples: + invalidProductType: + summary: The specified product type is invalid + value: + - attribute: productType + type: notInEnum + message: > + productType must be one of 'credit_card', 'insurance', + + 'life_insurance', 'loan', 'mortgage', 'savings', + 'other', + + but is 'invalid_product_type' + details: + specified: invalid_product_type + enum: + - credit_card + - insurance + - life_insurance + - loan + - mortgage + - savings + - other + - unknown + /identityHashes: + get: + summary: Get identity hashes + description: Return identity hashes based upon request parameters + operationId: getIdentityHashes + security: + - oauth: + - 'approval-probability:read' + tags: + - Identity Hash + parameters: + - name: id + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: leadUuid + in: query + schema: + type: array + items: + type: string + format: uuid + - name: leadUpdatedAtMin + in: query + schema: + type: string + format: date-time + - name: leadUpdatedAtMax + in: query + schema: + type: string + format: date-time + - name: createdAtMin + in: query + schema: + type: string + format: date-time + - name: createdAtMax + in: query + schema: + type: string + format: date-time + - name: createdBy + in: query + schema: + type: array + items: + type: string + format: uuid + - name: deletedAtMin + in: query + schema: + type: string + format: date-time + - name: deletedAtMax + in: query + schema: + type: string + format: date-time + - name: isDeleted + in: query + schema: + type: boolean + - name: deletedBy + in: query + schema: + type: array + items: + type: string + format: uuid + - name: offset + in: query + description: > + The number of resources to skip before the first resource in the + results. + schema: + type: integer + format: int64 + - name: limit + in: query + required: true + description: | + The maximum number of resources to include in the results. + schema: + type: integer + format: int32 + minimum: 1 + - name: sortBy + in: query + description: | + The attribute with which to sort the resources. + schema: + type: string + - name: order + in: query + description: | + The direction to use for ordering resources. + schema: + type: string + responses: + '200': + description: Identity hashes matching the query parameters + content: + application/json: + schema: + type: array + items: + $ref: ./schemas/identityHash.yml + '400': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + '422': + description: Invalid request + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + post: + summary: Create a identity hash + description: Create a identity hash + operationId: createIdentityHash + security: + - oauth: + - 'approval-probability:write' + tags: + - Identity Hash + requestBody: + content: + application/json: + schema: + $ref: ./schemas/identityHash.yml + responses: + '201': + description: The identity hash was created successfully + content: + application/json: + schema: + $ref: ./schemas/identityHash.yml + '400': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + '422': + description: Invalid request + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + '/identityHashes/{id}': + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + delete: + summary: Delete a identity hash + description: Delete a identity hash + operationId: deleteIdentityHash + security: + - oauth: + - 'approval-probability:write' + tags: + - Identity Hash + responses: + '200': + description: The identity hash was successfully deleted. + content: + application/json: + schema: + $ref: ./schemas/identityHash.yml + '404': + description: No identity hash exists for the specified ID diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/accessToken.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/accessToken.yml new file mode 100644 index 0000000..2b0ed0c --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/accessToken.yml @@ -0,0 +1,21 @@ +type: object +required: + - uuid + - resourceOwnerUuid + - scopes +properties: + uuid: + type: string + format: uuid + description: | + A unique identifier for the access token. + resourceOwnerUuid: + type: string + format: uuid + clientUuid: + type: string + format: uuid + scopes: + type: array + items: + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/accessTokenCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/accessTokenCreateData.yml new file mode 100644 index 0000000..494032f --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/accessTokenCreateData.yml @@ -0,0 +1,17 @@ +type: object +required: + - resourceOwnerUuid +properties: + resourceOwnerUuid: + type: string + format: uuid + clientUuid: + type: string + format: uuid + scopes: + type: array + items: + type: string + expiresIn: + type: integer + format: int64 diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/accessTokenWithSecret.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/accessTokenWithSecret.yml new file mode 100644 index 0000000..8a6d7e4 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/accessTokenWithSecret.yml @@ -0,0 +1,31 @@ +type: object +required: + - uuid + - secret + - resourceOwnerUuid + - scopes +properties: + uuid: + type: string + format: uuid + description: | + A unique identifier for this resource. + secret: + type: string + format: uuid + description: | + The secret UUID used to form the bearer token for this access token. + Cannot be retrieved after this point. + resourceOwnerUuid: + type: string + format: uuid + clientUuid: + type: string + format: uuid + scopes: + type: array + items: + type: string + expiresAt: + type: string + format: date-time diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/account.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/account.yml new file mode 100644 index 0000000..bc059b9 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/account.yml @@ -0,0 +1,40 @@ +type: object +required: + - id + - uuid + - roles + - createdAt + - createdById +properties: + id: + type: integer + format: int64 + description: | + A unique, internal identifier for this resource. + uuid: + type: string + format: uuid + description: | + A unique identifier for this resource. + roles: + type: string + createdAt: + type: string + format: date-time + description: | + When the account was created. + createdById: + type: string + format: uuid + description: | + The ID of the access token that was used to create this account. + deletedAt: + type: string + format: date-time + description: | + When the account was deleted. + deletedById: + type: string + format: uuid + description: | + The ID of the access token that was used to delete this account. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/accountCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/accountCreateData.yml new file mode 100644 index 0000000..f7765bb --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/accountCreateData.yml @@ -0,0 +1,8 @@ +type: object +required: + - roles +properties: + roles: + type: array + items: + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/accountUpdateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/accountUpdateData.yml new file mode 100644 index 0000000..a40dcef --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/accountUpdateData.yml @@ -0,0 +1,14 @@ +type: object +required: + - uuid + - roles +properties: + uuid: + type: string + format: uuid + description: | + The UUID of the account to update. + roles: + type: array + items: + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/application.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/application.yml new file mode 100644 index 0000000..c58d989 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/application.yml @@ -0,0 +1,41 @@ +type: object +required: + - id + - uuid + - name + - accountId + - companyUuid + - createdById +properties: + id: + type: integer + format: int64 + description: | + A unique, internal identifier for this resource. + uuid: + type: string + format: uuid + description: | + A unique identifier for this resource. + name: + type: string + accountId: + type: integer + format: int64 + description: | + The UUID of the company that this application belongs to + companyUuid: + type: string + format: uuid + description: | + A unique identifier for this resource. + createdById: + type: integer + format: int64 + description: | + The ID of the access token that was used to create this resource. + deletedById: + type: integer + format: int64 + description: | + The ID of the access token that was used to create this resource. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/applicationCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/applicationCreateData.yml new file mode 100644 index 0000000..5d590fe --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/applicationCreateData.yml @@ -0,0 +1,12 @@ +type: object +required: + - name + - accountId +properties: + name: + type: string + companyUuid: + type: string + format: uuid + description: | + The UUID of the company that this application belongs to diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/authCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/authCreateData.yml new file mode 100644 index 0000000..5ef8357 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/authCreateData.yml @@ -0,0 +1,9 @@ +type: object +required: + - access_token +properties: + access_token: + type: string + description: | + The bearer token to authenticate, which must be the corresponding access + token UUID and access token secret concatenated together with an underscore. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/company.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/company.yml new file mode 100644 index 0000000..164a498 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/company.yml @@ -0,0 +1,34 @@ +type: object +required: + - uuid + - name + - address1 + - city + - state + - zipCode + - phoneNumber + - roles +properties: + uuid: + type: string + format: uuid + description: | + A unique identifier for this resource. + name: + type: string + address1: + type: string + address2: + type: string + city: + type: string + state: + type: string + zipCode: + type: string + phoneNumber: + type: string + roles: + type: array + items: + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/companyCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/companyCreateData.yml new file mode 100644 index 0000000..4b6f455 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/companyCreateData.yml @@ -0,0 +1,28 @@ +type: object +required: + - name + - address1 + - city + - state + - zipCode + - phoneNumber + - roles +properties: + name: + type: string + address1: + type: string + address2: + type: string + city: + type: string + state: + type: string + zipCode: + type: string + phoneNumber: + type: string + roles: + type: array + items: + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/companyUpdateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/companyUpdateData.yml new file mode 100644 index 0000000..a6f5514 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/companyUpdateData.yml @@ -0,0 +1,34 @@ +type: object +required: + - uuid + - name + - address1 + - city + - state + - zipCode + - phoneNumber + - roles +properties: + uuid: + type: string + format: uuid + description: | + The UUID to update + name: + type: string + address1: + type: string + address2: + type: string + city: + type: string + state: + type: string + zipCode: + type: string + phoneNumber: + type: string + roles: + type: array + items: + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/internalAccessToken.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/internalAccessToken.yml new file mode 100644 index 0000000..eeacd9e --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/internalAccessToken.yml @@ -0,0 +1,55 @@ +type: object +required: + - id + - uuid + - resourceOwnerId + - createdAt + - createdById +properties: + id: + type: integer + format: int64 + description: | + A unique, internal identifier for this resource. + uuid: + type: string + format: uuid + description: | + A unique identifier for this resource. + resourceOwnerId: + type: integer + format: int64 + description: | + The account to whom any actions performed with this access token will be + attributed. + clientId: + type: integer + format: int64 + description: | + An option account (usually an application) that is performing actions + on behalf of the resource owner. + expiresAt: + type: string + format: date-time + description: | + When the resource expires. + createdAt: + type: string + format: date-time + description: | + When the resource was created. + createdById: + type: integer + format: int64 + description: | + The ID of the access token that was used to create this resource. + deletedAt: + type: string + format: date-time + description: | + When the resource was deleted. + deletedById: + type: integer + format: int64 + description: | + The ID of the access token that was used to delete this resource. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/login.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/login.yml new file mode 100644 index 0000000..dde2d67 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/login.yml @@ -0,0 +1,15 @@ +type: object +required: + - newAccessToken + - user +properties: + newAccessToken: + description: | + A new access token for the user + allOf: + - $ref: ./accessTokenWithSecret.yml + user: + description: | + The user associated with the login + allOf: + - $ref: ./user.yml diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/loginCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/loginCreateData.yml new file mode 100644 index 0000000..3b6035c --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/loginCreateData.yml @@ -0,0 +1,13 @@ +type: object +required: + - email + - password +properties: + email: + type: string + description: | + The email of the user for whom to create a login. + password: + type: string + description: | + The password of the specified user. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/passwordCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/passwordCreateData.yml new file mode 100644 index 0000000..63fa476 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/passwordCreateData.yml @@ -0,0 +1,18 @@ +type: object +required: + - emailAddress + - currentPassword + - newPassword +properties: + emailAddress: + type: string + description: | + The email of the user for whom to set a new password. + currentPassword: + type: string + description: | + The existing password of the specified user. + newPassword: + type: string + description: | + The new password for the specified user. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/passwordResetCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/passwordResetCreateData.yml new file mode 100644 index 0000000..1511421 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/passwordResetCreateData.yml @@ -0,0 +1,13 @@ +type: object +required: + - token + - newPassword +properties: + token: + type: string + description: | + The password reset request token received by email. + newPassword: + type: string + description: | + The new password to set for the user corresponding to the token. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/passwordResetRequestCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/passwordResetRequestCreateData.yml new file mode 100644 index 0000000..2b834dd --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/passwordResetRequestCreateData.yml @@ -0,0 +1,8 @@ +type: object +required: + - emailAddress +properties: + emailAddress: + type: string + description: | + The email of the user for whom to create a password reset. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/richAccessToken.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/richAccessToken.yml new file mode 100644 index 0000000..46a7711 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/richAccessToken.yml @@ -0,0 +1,17 @@ +type: object +required: + - uuid + - scopes + - richAccount +properties: + uuid: + type: string + format: uuid + description: | + A unique identifier for the access token. + scopes: + type: array + items: + type: string + richAccount: + $ref: ./richAccount.yml diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/richAccount.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/richAccount.yml new file mode 100644 index 0000000..1d00f2d --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/richAccount.yml @@ -0,0 +1,32 @@ +type: object +required: + - id + - uuid + - roles + - createdAt + - createdById +properties: + account: + $ref: ./account.yml + company: + description: | + The company that this account belongs to + allOf: + - $ref: ./company.yml + application: + description: | + The application that decorates this account, if any. + allOf: + - $ref: ./application.yml + user: + description: | + The user that decorates this account, if any. + allOf: + - $ref: ./user.yml + service: + description: | + The service that decorates this account, if any. The service concept is + deprecated and will ultimately be removed. + deprecated: true + allOf: + - $ref: ./service.yml diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/role.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/role.yml new file mode 100644 index 0000000..f770aca --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/role.yml @@ -0,0 +1,46 @@ +type: object +required: + - id + - key + - description + - scopes + - createdAt + - createdById +properties: + id: + type: integer + format: int64 + description: | + A unique, internal identifier for this role. + key: + type: string + description: | + A unique, human-readable identifier for this role. + description: + type: string + scopes: + type: array + description: | + The scopes that belong to this role + items: + type: string + createdAt: + type: string + format: date-time + description: | + When the role was created. + createdById: + type: integer + format: int64 + description: | + The ID of the access token that was used to create this role. + deletedAt: + type: string + format: date-time + description: | + When the resource was deleted. + deletedById: + type: integer + format: int64 + description: | + The ID of the access token that was used to delete this role. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/roleCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/roleCreateData.yml new file mode 100644 index 0000000..b57d3d9 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/roleCreateData.yml @@ -0,0 +1,18 @@ +type: object +required: + - key + - description + - scopes +properties: + key: + type: string + description: | + A unique, human-readable identifier for this role. + description: + type: string + scopes: + type: array + description: | + Scopes to add to this role + items: + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/roleScopes.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/roleScopes.yml new file mode 100644 index 0000000..e64873e --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/roleScopes.yml @@ -0,0 +1,10 @@ +type: object +required: + - scopes +properties: + scopes: + type: array + description: | + Scopes to add to this role + items: + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/scope.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/scope.yml new file mode 100644 index 0000000..f04fac8 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/scope.yml @@ -0,0 +1,39 @@ +type: object +required: + - id + - key + - description + - createdAt + - createdById +properties: + id: + type: integer + format: int64 + description: | + A unique, internal identifier for this scope. + key: + type: string + description: | + A unique, human-readable identifier for this role. + description: + type: string + createdAt: + type: string + format: date-time + description: | + When the resource was created. + createdById: + type: integer + format: int64 + description: | + The ID of the access token that was used to create this resource. + deletedAt: + type: string + format: date-time + description: | + When the resource was deleted. + deletedById: + type: integer + format: int64 + description: | + The ID of the access token that was used to delete this resource. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/scopeCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/scopeCreateData.yml new file mode 100644 index 0000000..8e99622 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/scopeCreateData.yml @@ -0,0 +1,18 @@ +type: object +required: + - key + - description + - roles +properties: + key: + type: string + description: | + A unique, human-readable identifier for this role. + description: + type: string + roles: + type: array + description: | + The roles that this scope should belong to + items: + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/service.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/service.yml new file mode 100644 index 0000000..d9bc732 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/service.yml @@ -0,0 +1,18 @@ +type: object +required: + - uuid + - accountUuid + - companyUuid + - name +properties: + uuid: + type: string + format: uuid + accountUuid: + type: string + format: uuid + companyUuid: + type: string + format: uuid + name: + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/user.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/user.yml new file mode 100644 index 0000000..698ab02 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/user.yml @@ -0,0 +1,94 @@ +type: object +required: + - id + - uuid + - accountId + - accountUuid + - companyUuid + - emailAddress + - firstName + - lastName + - createdAt + - createdById +properties: + id: + type: integer + format: int64 + description: | + A unique, internal identifier for this user. + uuid: + type: string + format: uuid + description: | + A unique identifier for this user. + accountId: + type: integer + format: int64 + description: | + The ID of the account resource for this user + accountUuid: + type: string + format: uuid + description: | + The UUID of the account resource for this user + companyUuid: + type: string + format: uuid + description: | + The UUID of the company that this user belongs to + emailAddress: + type: string + description: | + The user's email address. + firstName: + type: string + description: | + The user's email address. + lastName: + type: string + description: | + The user's email address. + title: + type: string + description: | + The user's email address. + createdAt: + type: string + format: date-time + description: | + When the user was created. + createdById: + type: integer + format: int64 + description: | + The ID of the access token that was used to create this user. + updatedAt: + type: string + format: date-time + description: | + When the user was last updated. + updatedById: + type: integer + format: int64 + description: | + The ID of the access token that was used to last update this user. + deactivatedAt: + type: string + format: date-time + description: | + When the user was deactivated. + deactivatedBy: + type: string + format: uuid + description: | + The UUID of the access token that was used to deactivate this resource. + deletedAt: + type: string + format: date-time + description: | + When the user was deleted. + deletedById: + type: integer + format: int64 + description: | + The ID of the access token that was used to delete this user. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/userCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/userCreateData.yml new file mode 100644 index 0000000..8c63043 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/userCreateData.yml @@ -0,0 +1,43 @@ +type: object +required: + - companyUuid + - emailAddress + - firstName + - lastName + - roles +properties: + companyUuid: + type: string + format: uuid + description: | + The UUID of the company that this user belongs to + emailAddress: + type: string + description: | + The user's email address. + firstName: + type: string + description: | + The user's email address. + lastName: + type: string + description: | + The user's email address. + title: + type: string + description: | + The user's email address. + roles: + type: array + description: | + The roles that this user should belong to. + items: + type: string + password: + type: string + description: | + The user's password, used to create access tokens for this user. + expiresImmediately: + type: boolean + description: | + Whether the user's password expires immediately. Defaults to false. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/userDeactivation.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/userDeactivation.yml new file mode 100644 index 0000000..93f54e1 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/userDeactivation.yml @@ -0,0 +1,41 @@ +type: object +required: + - id + - userId + - createdAt + - createdBy +properties: + id: + type: integer + format: int64 + description: | + A unique, internal identifier for this resource. + userId: + type: integer + format: int64 + description: | + An identifier for the user that is deactivated. + deactivationReason: + type: string + description: | + Reason why the user was deactivated. + createdAt: + type: string + format: date-time + description: | + When the resource was created. + createdBy: + type: string + format: uuid + description: | + The UUID of the access token that was used to create this resource. + deletedAt: + type: string + format: date-time + description: | + When the resource was deleted. + deletedBy: + type: string + format: uuid + description: | + The UUID of the access token that was used to delete this resource. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/userDeactivationCreateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/userDeactivationCreateData.yml new file mode 100644 index 0000000..2ade13e --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/userDeactivationCreateData.yml @@ -0,0 +1,15 @@ +type: object +required: + - userIds +properties: + userIds: + type: array + items: + type: integer + format: int64 + description: | + The IDs of the users to be deactivated. + deactivationReason: + type: string + description: | + Reason why the users were deactivated. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/schemas/userUpdateData.yml b/Tests/Fixtures/acme/birch-catalog/auth/schemas/userUpdateData.yml new file mode 100644 index 0000000..e1f860d --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/schemas/userUpdateData.yml @@ -0,0 +1,49 @@ +type: object +required: + - uuid + - companyUuid + - emailAddress + - firstName + - lastName + - roles +properties: + uuid: + type: string + format: uuid + description: | + The UUID of the user to update + companyUuid: + type: string + format: uuid + description: | + The UUID of the company that this user belongs to + emailAddress: + type: string + description: | + The user's email address. + firstName: + type: string + description: | + The user's email address. + lastName: + type: string + description: | + The user's email address. + title: + type: string + description: | + The user's email address. + roles: + type: array + description: | + The roles that this user should belong to. + items: + type: string + password: + type: string + description: | + The user's password, used to create access tokens for this user. + expiresImmediately: + type: boolean + description: | + Whether the user's password expires immediately. Defaults to false. diff --git a/Tests/Fixtures/acme/birch-catalog/auth/spec.yml b/Tests/Fixtures/acme/birch-catalog/auth/spec.yml new file mode 100644 index 0000000..74ed1a5 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/auth/spec.yml @@ -0,0 +1,1699 @@ +openapi: 3.0.3 +info: + title: auth + description: | + Centralized authentication service for Even + version: 1.4.0 + contact: + name: API Chapter + url: >- + https://example.com/docs/api-team +servers: + - url: 'https://api.example.com/auth' + description: Prod + - url: 'https://dev-api.example.com/auth' + description: Dev +components: + securitySchemes: + oauth: + type: oauth2 + flows: + clientCredentials: + tokenUrl: /auth/accessTokens + scopes: + 'auth:read': Deprecated scope + 'auth:write': Deprecated scope + 'get:account': Deprecated scope + 'get:company': Deprecated scope + 'get:user': Deprecated scope + 'create:access-token': Deprecated scope + 'create:account': Deprecated scope + 'create:company': Deprecated scope + 'create:company-user': Deprecated scope + 'create:role_scope': Deprecated scope + 'delete:role_scope': Deprecated scope + 'list:account': Deprecated scope + 'list:company': Deprecated scope + 'list:user': Deprecated scope + 'update:account': Deprecated scope + 'update:company': Deprecated scope + 'update:user': Deprecated scope + schemas: + AccessToken: + $ref: ./schemas/accessToken.yml + AccessTokenCreateData: + $ref: ./schemas/accessTokenCreateData.yml + AccessTokenSort: + type: string + enum: + - created_at + - deleted_at + - id + AccessTokenWithSecret: + $ref: ./schemas/accessTokenWithSecret.yml + Account: + $ref: ./schemas/account.yml + AccountCreateData: + $ref: ./schemas/accountCreateData.yml + AccountSort: + type: string + enum: + - created_at + - deleted_at + AccountUpdateData: + $ref: ./schemas/accountUpdateData.yml + ApiError: + $ref: ../core/schemas/apiError.yml + Application: + $ref: ./schemas/application.yml + ApplicationCreateData: + $ref: ./schemas/applicationCreateData.yml + ApplicationSort: + type: string + enum: + - created_at + - deleted_at + - id + - name + AuthCreateData: + $ref: ./schemas/authCreateData.yml + Company: + $ref: ./schemas/company.yml + CompanyCreateData: + $ref: ./schemas/companyCreateData.yml + CompanyUpdateData: + $ref: ./schemas/companyUpdateData.yml + InternalAccessToken: + $ref: ./schemas/internalAccessToken.yml + Login: + $ref: ./schemas/login.yml + LoginCreateData: + $ref: ./schemas/loginCreateData.yml + Order: + $ref: ../core/schemas/order.yml + PasswordCreateData: + $ref: ./schemas/passwordCreateData.yml + PasswordResetCreateData: + $ref: ./schemas/passwordResetCreateData.yml + PasswordResetRequestCreateData: + $ref: ./schemas/passwordResetRequestCreateData.yml + RichAccessToken: + $ref: ./schemas/richAccessToken.yml + RichAccount: + $ref: ./schemas/richAccount.yml + Role: + $ref: ./schemas/role.yml + RoleCreateData: + $ref: ./schemas/roleCreateData.yml + RoleScopes: + $ref: ./schemas/roleScopes.yml + RoleSort: + type: string + enum: + - created_at + - deleted_at + - id + - key + Service: + $ref: ./schemas/service.yml + Scope: + $ref: ./schemas/scope.yml + ScopeCreateData: + $ref: ./schemas/scopeCreateData.yml + ScopeSort: + type: string + enum: + - created_at + - deleted_at + - key + User: + $ref: ./schemas/user.yml + UserCreateData: + $ref: ./schemas/userCreateData.yml + UserSort: + type: string + enum: + - created_at + - deleted_at + - id + - name + UserUpdateData: + $ref: ./schemas/userUpdateData.yml + UserDeactivation: + $ref: ./schemas/userDeactivation.yml + UserDeactivationCreateData: + $ref: ./schemas/userDeactivationCreateData.yml +tags: + - name: Access Token + - name: Account + - name: Application + - name: Auth + - name: Company + - name: Password + - name: Role + - name: Scope + - name: User + - name: User Deactivation +paths: + /users: + get: + x-lint-skip: + - index-endpoint-has-limit + summary: Get users + description: | + Get users + tags: + - User + operationId: getUsers + security: + - oauth: + - 'list:user' + parameters: + - name: id + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: uuid + in: query + schema: + type: array + items: + type: string + format: uuid + - name: accountId + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: companyId + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: email + in: query + schema: + type: array + items: + type: string + - name: createdById + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: deletedById + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: isDeleted + in: query + schema: + type: boolean + default: false + - name: isDeactivated + in: query + schema: + type: boolean + default: false + - name: offset + in: query + schema: + type: integer + format: int32 + default: 0 + - name: limit + in: query + schema: + type: integer + format: int32 + - name: sortBy + in: query + schema: + $ref: '#/components/schemas/UserSort' + - name: order + in: query + schema: + $ref: '#/components/schemas/Order' + responses: + '200': + description: Users matching the query parameters + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + '401': + description: Unauthorized + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + post: + summary: Create user + description: | + Create user + tags: + - User + operationId: createUser + security: + - oauth: + - 'create:company-user' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserCreateData' + responses: + '201': + description: User created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '401': + description: Unauthorized + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + '409': + description: Invalid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + put: + summary: Update user + description: | + Update user + tags: + - User + operationId: updateUser + security: + - oauth: + - 'update:user' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserUpdateData' + responses: + '200': + description: User updated successfully + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '409': + description: Invalid data + '/users/{uuid}': + parameters: + - name: uuid + in: path + required: true + description: The UUID of the user + schema: + type: string + format: uuid + get: + summary: Get user + description: | + Create user + tags: + - User + operationId: getUser + security: + - oauth: + - 'get:user' + responses: + '200': + description: User for the specified ID + content: + application/json: + schema: + $ref: '#/components/schemas/User' + '409': + description: Unknown user UUID + delete: + summary: Delete user + description: | + Delete user + tags: + - User + operationId: deleteUser + security: + - oauth: + - 'update:user' + responses: + '200': + description: User deleted successfully + /accessTokens: + get: + x-lint-skip: + - index-endpoint-has-limit + summary: Get access tokens + description: | + Get access tokens + tags: + - Access Token + operationId: getAccessTokens + security: + - oauth: + - 'auth:read' + parameters: + - name: id + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: uuid + in: query + schema: + type: array + items: + type: string + format: uuid + - name: resourceOwnerId + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: clientId + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: createdById + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: deletedById + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: excludeDeleted + in: query + schema: + type: boolean + default: true + - name: offset + in: query + schema: + type: integer + format: int32 + default: 0 + - name: limit + in: query + schema: + type: integer + format: int32 + default: 1000 + - name: sortBy + in: query + schema: + $ref: '#/components/schemas/AccessTokenSort' + - name: order + in: query + schema: + $ref: '#/components/schemas/Order' + responses: + '200': + description: Access tokens matching the query parameters + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/InternalAccessToken' + '401': + description: Unauthorized + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + post: + summary: Create an access token + description: | + Create an access token + tags: + - Access Token + operationId: createAccessToken + security: + - oauth: + - 'create:access-token' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenCreateData' + responses: + '201': + description: Access token created + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenWithSecret' + '401': + description: Unauthorized + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + '409': + description: Invalid request + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + '/accessTokens/{id}': + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + delete: + summary: Delete an access token + description: Delete an access token + operationId: deleteAccessToken + security: + - oauth: + - 'auth:write' + tags: + - Access Token + responses: + '204': + description: The access token was successfully deleted. + '404': + description: No access token exists for the specified ID + /richAccessTokens: + get: + x-lint-skip: + - index-endpoint-has-limit + summary: Get rich access tokens + description: Return rich access tokens based upon request parameters + operationId: getRichAccessTokens + security: + - oauth: + - 'list:account' + tags: + - Access Token + parameters: + - name: id + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: accessTokenUuid + in: query + schema: + type: array + items: + type: string + format: uuid + - name: limit + in: query + schema: + type: integer + format: int32 + default: 1000 + minimum: 1 + responses: + '200': + description: Rich access tokens matching the query parameters + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RichAccessToken' + /applications: + get: + summary: Get applications + description: Return applications based upon request parameters + operationId: getApplications + security: + - oauth: + - 'auth:read' + tags: + - Application + parameters: + - name: id + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: uuid + in: query + schema: + type: array + items: + type: string + format: uuid + - name: accountId + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: companyUuid + in: query + schema: + type: array + items: + type: string + format: uuid + - name: createdById + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: deletedById + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: offset + in: query + description: > + The number of resources to skip before the first resource in the + results. + schema: + type: integer + format: int64 + minimum: 0 + - name: limit + in: query + required: true + description: | + The maximum number of resources to include in the results. + schema: + type: integer + format: int32 + minimum: 1 + - name: sortBy + in: query + description: | + The attribute with which to sort the resources. + schema: + $ref: '#/components/schemas/ApplicationSort' + - name: order + in: query + description: | + The direction to use for ordering resources. + schema: + $ref: '#/components/schemas/Order' + responses: + '200': + description: Applications matching the query parameters + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Application' + post: + summary: Create a application + description: Create a application + operationId: createApplication + security: + - oauth: + - 'auth:write' + tags: + - Application + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ApplicationCreateData' + responses: + '201': + description: The application was created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Application' + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + '/applications/{id}': + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + delete: + summary: Delete a application + description: Delete a application + operationId: deleteApplication + security: + - oauth: + - 'auth:write' + tags: + - Application + responses: + '204': + description: The application was successfully deleted. + '404': + description: No application exists for the specified ID + /roles: + get: + summary: Get roles + description: Return roles based upon request parameters + operationId: getRoles + security: + - oauth: + - 'auth:read' + tags: + - Role + parameters: + - name: id + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: key + in: query + schema: + type: array + items: + type: string + - name: scopes + in: query + schema: + type: array + items: + type: string + - name: createdById + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: deletedById + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: offset + in: query + description: > + The number of resources to skip before the first resource in the + results. + schema: + type: integer + format: int64 + minimum: 0 + - name: limit + in: query + required: true + description: | + The maximum number of resources to include in the results. + schema: + type: integer + format: int32 + minimum: 1 + - name: sortBy + in: query + description: | + The attribute with which to sort the resources. + schema: + $ref: '#/components/schemas/RoleSort' + - name: order + in: query + description: | + The direction to use for ordering resources. + schema: + $ref: '#/components/schemas/Order' + responses: + '200': + description: Roles matching the query parameters + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + post: + summary: Create a role + description: Create a role + operationId: createRole + security: + - oauth: + - 'auth:write' + tags: + - Role + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RoleCreateData' + responses: + '201': + description: The role was created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + '/roles/{key}': + parameters: + - name: key + in: path + required: true + schema: + type: string + delete: + summary: Delete a role + description: Delete a role + operationId: deleteRole + security: + - oauth: + - 'auth:write' + tags: + - Role + responses: + '204': + description: The role was successfully deleted. + '409': + description: No role exists for the specified ID + '/roles/{roleKey}/scopes': + parameters: + - name: roleKey + in: path + required: true + schema: + type: string + post: + summary: Add scopes to a role + description: Add scopes to a role + operationId: addScopesToRole + security: + - oauth: + - 'create:role_scope' + tags: + - Role + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RoleScopes' + responses: + '201': + description: The specified role with scopes added + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Role' + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + '/roles/{roleKey}/scopes/{scopeKey}': + parameters: + - name: roleKey + in: path + required: true + schema: + type: string + - name: scopeKey + in: path + required: true + schema: + type: string + delete: + summary: Remove a scope from a role + description: Remove a scope from a role + operationId: removeScopeFromRole + security: + - oauth: + - 'delete:role_scope' + tags: + - Role + responses: + '204': + description: The scope was removed from the role + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + /scopes: + get: + summary: Get scopes + description: Return scopes based upon request parameters + operationId: getScopes + security: + - oauth: + - 'auth:read' + tags: + - Scope + parameters: + - name: id + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: key + in: query + schema: + type: array + items: + type: string + - name: createdById + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: deletedById + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: offset + in: query + description: > + The number of resources to skip before the first resource in the + results. + schema: + type: integer + format: int64 + minimum: 0 + - name: limit + in: query + required: true + description: | + The maximum number of resources to include in the results. + schema: + type: integer + format: int32 + minimum: 1 + - name: sortBy + in: query + description: | + The attribute with which to sort the resources. + schema: + $ref: '#/components/schemas/ScopeSort' + - name: order + in: query + description: | + The direction to use for ordering resources. + schema: + $ref: '#/components/schemas/Order' + responses: + '200': + description: Scopes matching the query parameters + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Scope' + post: + summary: Create a scope + description: Create a scope + operationId: createScope + security: + - oauth: + - 'auth:write' + tags: + - Scope + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ScopeCreateData' + responses: + '201': + description: The scope was created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Scope' + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + '/scopes/{key}': + parameters: + - name: key + in: path + required: true + schema: + type: string + delete: + summary: Delete a scope + description: Delete a scope + operationId: deleteScope + security: + - oauth: + - 'auth:write' + tags: + - Scope + responses: + '204': + description: The scope was successfully deleted. + '404': + description: No scope exists for the specified ID + /companies: + get: + summary: Get companies + description: Return companies based upon request parameters + operationId: getCompanies + security: + - oauth: + - 'list:company' + tags: + - Company + parameters: + - name: offset + in: query + description: > + The number of resources to skip before the first resource in the + results. + schema: + type: integer + format: int64 + default: 0 + minimum: 0 + - name: limit + in: query + required: true + description: | + The maximum number of resources to include in the results. + schema: + type: integer + format: int32 + default: 10 + minimum: 1 + responses: + '200': + description: Companies matching the query parameters + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Company' + post: + summary: Create a company + description: Create a company + operationId: createCompany + security: + - oauth: + - 'create:company' + tags: + - Company + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CompanyCreateData' + responses: + '201': + description: The company was created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Company' + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + put: + summary: Update a company + description: Update a company + operationId: updateCompany + security: + - oauth: + - 'update:company' + tags: + - Company + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CompanyUpdateData' + responses: + '200': + description: The company was successfully deleted. + content: + application/json: + schema: + $ref: '#/components/schemas/Company' + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + '/companies/{uuid}': + parameters: + - name: uuid + in: path + required: true + schema: + type: string + format: uuid + get: + summary: Get one company + description: Return company for a UUID + operationId: getCompany + security: + - oauth: + - 'get:company' + tags: + - Company + responses: + '200': + description: Company for specified UUID + content: + application/json: + schema: + $ref: '#/components/schemas/Company' + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + '/companies/{companyUuid}/accessTokens': + parameters: + - name: companyUuid + in: path + required: true + schema: + type: string + format: uuid + get: + summary: Get a company's access tokens + description: Return access tokens that belong to a company + operationId: getCompanyAccessTokens + security: + - oauth: + - 'auth:read' + tags: + - Company + responses: + '200': + description: Company for specified UUID + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AccessToken' + '404': + description: Company UUID not found + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + /accounts: + get: + summary: Get accounts + description: Return accounts based upon request parameters + operationId: getAccounts + security: + - oauth: + - 'list:account' + tags: + - Account + parameters: + - name: id + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: uuid + in: query + schema: + type: array + items: + type: string + format: uuid + - name: createdById + in: query + schema: + type: array + items: + type: string + format: uuid + - name: deletedById + in: query + schema: + type: array + items: + type: string + format: uuid + - name: offset + in: query + description: > + The number of resources to skip before the first resource in the + results. + schema: + type: integer + format: int64 + - name: limit + in: query + required: true + description: | + The maximum number of resources to include in the results. + schema: + type: integer + format: int32 + minimum: 1 + - name: sortBy + in: query + description: | + The attribute with which to sort the resources. + schema: + $ref: '#/components/schemas/AccountSort' + - name: order + in: query + description: | + The direction to use for ordering resources. + schema: + $ref: '#/components/schemas/Order' + responses: + '200': + description: Accounts matching the query parameters + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Account' + post: + summary: Create an account + description: Create an account + operationId: createAccount + security: + - oauth: + - 'create:account' + tags: + - Account + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AccountCreateData' + responses: + '201': + description: The account was created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Account' + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + put: + summary: Update an account + description: Update an account + operationId: updateAccount + security: + - oauth: + - 'update:account' + tags: + - Account + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AccountUpdateData' + responses: + '201': + description: The account was created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Account' + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + '/accounts/{uuid}': + parameters: + - name: uuid + in: path + required: true + schema: + type: string + format: uuid + get: + summary: Get one account + description: Return account for a UUID + operationId: getAccount + security: + - oauth: + - 'get:account' + tags: + - Account + responses: + '200': + description: The account was successfully deleted. + content: + application/json: + schema: + $ref: '#/components/schemas/Account' + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + /richAccounts: + get: + x-lint-skip: + - index-endpoint-has-limit + summary: Get rich accounts + description: Return rich accounts based upon request parameters + operationId: getRichAccounts + security: + - oauth: + - 'list:account' + tags: + - Account + parameters: + - name: id + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: accessTokenUuid + in: query + schema: + type: array + items: + type: string + format: uuid + - name: accountUuid + in: query + schema: + type: array + items: + type: string + format: uuid + responses: + '200': + description: Rich accounts matching the query parameters + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RichAccount' + /auths: + post: + summary: Authenticate a bearer token + description: Exchange a bearer token for its access token + operationId: createAuth + tags: + - Auth + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthCreateData' + responses: + '201': + description: The account was created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/AccessToken' + '401': + description: The bearer token is invalid + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + '409': + description: Invalid request provided + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + /logins: + post: + summary: Create a user login + description: Create a new access token using email / password pair + operationId: createLogin + tags: + - Auth + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LoginCreateData' + responses: + '201': + description: The account was created successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Login' + '401': + description: The email / password pair is invalid + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ApiError' + /passwords: + post: + summary: Update a user password + description: Update a user password using email and the existing password. + operationId: updatePassword + tags: + - Password + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordCreateData' + responses: + '204': + description: The password was updated successfully + '401': + description: Invalid email / password pair + /passwords/resetRequests: + post: + summary: Create a password reset request. + description: | + Initiates an email to the specifed a token that can be used change the + associated user's password + operationId: requestPasswordReset + tags: + - Password + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordResetRequestCreateData' + responses: + '204': + description: An email has been sent to the specified email + '401': + description: Unknown email + /passwords/resets: + post: + summary: Reset a user password via token. + description: | + Updates the email of the user associated with the specified reset + request token. + operationId: resetPassword + tags: + - Password + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordResetCreateData' + responses: + '204': + description: The password was updated successfully. + '401': + description: Unknown reset request token + /userDeactivations: + get: + summary: Get user deactivations + description: Return user deactivations based upon request parameters + operationId: getUserDeactivations + security: + - oauth: + - 'auth:read' + tags: + - User Deactivation + parameters: + - name: id + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: userId + in: query + schema: + type: array + items: + type: integer + format: int64 + - name: createdAtMin + in: query + schema: + type: string + format: date-time + - name: createdAtMax + in: query + schema: + type: string + format: date-time + - name: createdBy + in: query + schema: + type: array + items: + type: string + format: uuid + - name: deletedAtMin + in: query + schema: + type: string + format: date-time + - name: deletedAtMax + in: query + schema: + type: string + format: date-time + - name: isDeleted + in: query + schema: + type: boolean + - name: deletedBy + in: query + schema: + type: array + items: + type: string + format: uuid + - name: offset + in: query + description: > + The number of resources to skip before the first resource in the + results. + schema: + type: integer + format: int64 + - name: limit + in: query + required: true + description: | + The maximum number of resources to include in the results. + schema: + type: integer + format: int32 + minimum: 1 + - name: sortBy + in: query + description: | + The attribute with which to sort the resources. + schema: + type: string + - name: order + in: query + description: | + The direction to use for ordering resources. + schema: + type: string + responses: + '200': + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserDeactivation' + '400': + description: Invalid request + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + post: + summary: Create user deactivations + description: Create user deactivation + operationId: createUserDeactivation + security: + - oauth: + - 'auth:write' + tags: + - User Deactivation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserDeactivationCreateData' + responses: + '202': + description: Success + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserDeactivation' + '400': + description: Invalid request + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + '/userDeactivations/{id}': + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + delete: + summary: Delete a user deactivation + description: Delete a user deactivation + operationId: deleteUserDeactivation + security: + - oauth: + - 'auth:write' + tags: + - User Deactivation + responses: + '204': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/UserDeactivation' + '404': + description: Unknown ID diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/benefit.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/benefit.yml new file mode 100644 index 0000000..c973f09 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/benefit.yml @@ -0,0 +1,12 @@ +type: object +description: A benefit +properties: + text: + type: string + description: The name of the benefit + detail: + type: string + description: Additional text of the benefit + uuid: + type: string + format: uuid diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/cardFamily.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/cardFamily.yml new file mode 100644 index 0000000..f8d057a --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/cardFamily.yml @@ -0,0 +1,15 @@ +type: object +description: a group of cards that share branding, like the chase sapphire perferrec and reserve. +properties: + uuid: + type: string + format: uuid + name: + type: string + issuer: + $ref: ./issuer.yml + cards: + type: array + items: + type: string + diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/cardMatch.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/cardMatch.yml new file mode 100644 index 0000000..001155d --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/cardMatch.yml @@ -0,0 +1,16 @@ +type: object +description: A mapping of an aggregator's credit card account and a atlas credit card +properties: + subAccountId: + description: The Atlas SubAccount id (this is also a Plaid account id, or a finicity account id) + type: string + cardUuid: + description: The card associated with this account + type: string + format: uuid + nullable: true + openDate: + description: The date the account was opened + type: string + format: date + nullable: true diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/category.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/category.yml new file mode 100644 index 0000000..44f858f --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/category.yml @@ -0,0 +1,15 @@ +type: object +description: A Category +properties: + uuid: + type: string + format: uuid + name: + type: string + description: A detailed name for the category + displayName: + type: string + description: A more user friendly name for the category + phrase: + type: string + description: Sentence friendly diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/baseCreditCard.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/baseCreditCard.yml new file mode 100644 index 0000000..056d45f --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/baseCreditCard.yml @@ -0,0 +1,11 @@ +type: object +description: The root credit card object with all descriminators +properties: + uuid: + type: string + format: uuid + type: + $ref: ./creditCardRepresentations.yml + personlizationLevel: + $ref: ../personalizationLevels.yml + diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/compactCreditCard.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/compactCreditCard.yml new file mode 100644 index 0000000..36a640f --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/compactCreditCard.yml @@ -0,0 +1,43 @@ +type: object +description: Limited information about a credit card +allOf: + - $ref: ./baseCreditCard.yml + - type: object + properties: + names: + description: Legal name, nickname, shortname, ext + type: array + items: + $ref: ../structures/name.yml + images: + description: full card image, square image, etc, other assets. + type: array + items: + $ref: ../structures/image.yml + issuer: + $ref: ../issuer.yml + network: + $ref: ../network.yml + family: + $ref: ../cardFamily.yml + links: + description: Apply and terms links + type: array + items: + $ref: ../structures/link.yml + source: + type: object + description: Explains where the credit card offer details were found, and how recently + properties: + integration: + type: string + description: Describes the mechanics of how card data is gathered + connection: + type: string + description: id of connector + lastModified: + type: string + description: the last time this record was changed + lastValidated: + type: string + description: the last time this record checked for compliance diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/creditCardRepresentations.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/creditCardRepresentations.yml new file mode 100644 index 0000000..02b4ee9 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/creditCardRepresentations.yml @@ -0,0 +1,6 @@ +title: CreditCardRepresentation +type: string +description: Descriminator for how detailed the Credit Card response is +enum: + - compact + - full diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/fullCreditCard.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/fullCreditCard.yml new file mode 100644 index 0000000..65f0e7e --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/credit-card/fullCreditCard.yml @@ -0,0 +1,41 @@ +type: object +description: A Atlas Representation of a Credit Card +allOf: + - $ref: ./compactCreditCard.yml + - type: object + properties: + restrictions: + type: object + description: what stops you from getting it + properties: + student: + type: boolean + description: Denotes whether this card is only offered to students + military: + type: boolean + description: Denotes whether this card is only offered to active duty military personel + minCreditScore: + type: integer + maxCreditScore: + type: integer + rates: + $ref: ../rate.yml + fees: + description: annual, foreign transaction fees, late fees, etc. + type: array + items: + $ref: ../fee.yml + benefits: + type: array + items: + $ref: ../benefit.yml + description: Additional Benefits you recieve with this card + earningProgram: + $ref: ../earning-program/earningProgram.yml + ratings: + $ref: ../rating.yml + additionalDetails: + description: Additional Marketing Bullets + type: array + items: + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/bonusPersonalization.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/bonusPersonalization.yml new file mode 100644 index 0000000..3d623cf --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/bonusPersonalization.yml @@ -0,0 +1,10 @@ +type: object +description: Personalized values calculated for a specific bonus, such as a Sign On Bonus +properties: + minimumSpendMet: + type: boolean + description: Were the conditions of the bonus met + qualifyingSpend: + type: string + description: The amount of spend the user had within the time period of the bounus + diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/categoryEarningItem.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/categoryEarningItem.yml new file mode 100644 index 0000000..b15829e --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/categoryEarningItem.yml @@ -0,0 +1,9 @@ +type: object +description: An association of an earn rate and a category +allOf: + - $ref: ./earningItem.yml + - type: object + properties: + category: + $ref: ../category.yml + description: The category of the item diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningBonus.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningBonus.yml new file mode 100644 index 0000000..ab26012 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningBonus.yml @@ -0,0 +1,29 @@ +type: object +description: An earning event which is based on spend or is over time +required: + - type + - name + - bonus + - redemptionValue + - requirement +properties: + type: + type: string + enum: + - One Time + - Recurring + name: + type: string + enum: + - Sign-Up Bonus + - Anniversary Bonus + - Annual Bonus + - Usage Bouns + bonus: + type: string + redemptionValue: + type: string + requirement: + type: string + personalization: + $ref: ./bonusPersonalization.yml diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningContext.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningContext.yml new file mode 100644 index 0000000..e8bbc53 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningContext.yml @@ -0,0 +1,29 @@ +type: object +description: A context around a nuumber of earning groups, such as caps, tiers, etc +required: + - groups + - type +properties: + type: + description: The type of context this is. Basic contexts have no details. + type: string + enum: + - basic + - calculation + - introductory + - rotating + - capped + groups: + description: The earning groups relevent in this context + type: array + items: + $ref: ./earningGroup.yml + detail: + description: A phrase describing the context around the earning groups + type: string + explaination: + description: A full sentence describing the context around the earning groups + type: string + personalization: + $ref: ./earningItemPersonalization.yml + diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningGroup.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningGroup.yml new file mode 100644 index 0000000..cea1670 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningGroup.yml @@ -0,0 +1,26 @@ +type: object +description: A group of qualifiers which share the same default earn rate +required: + - earnRate + - earnRateText + - items +properties: + earnRate: + type: number + description: Numerical representation of the earn rate for this group + earnRateText: + type: string + description: Display text for what the group earns + items: + type: array + items: + oneOf: + - $ref: ./categoryEarningItem.yml + - $ref: ./merchantEarningItem.yml + discriminator: + propertyName: type + mapping: + category: './categoryEarningItem.yml' + merchant: './merchantEarningItem.yml' + personalization: + $ref: ./earningItemPersonalization.yml diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningItem.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningItem.yml new file mode 100644 index 0000000..9c6ac96 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningItem.yml @@ -0,0 +1,18 @@ +type: object +description: An association of an earn rate and a qualifier, like a category or merchant +required: + - type +properties: + type: + description: Refers to the type (and schema) of the item + type: string + enum: + - category + - merchant + - ebp + - paymentMethod + earnRate: + type: number + description: Numerical representation of the default earn rate per dollar spent of the item + personalization: + $ref: ./earningItemPersonalization.yml diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningItemPersonalization.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningItemPersonalization.yml new file mode 100644 index 0000000..a0f1d5a --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningItemPersonalization.yml @@ -0,0 +1,12 @@ +type: object +description: Personalized values calculated for a specific item, such as an earning group or bonus +properties: + totalSpent: + type: number + description: The amount the user spent in dollars within a calendar year + totalEarned: + type: number + description: The amount of points/miles/dollars the user would have received within a calendar year + totalValue: + type: number + description: The value in USD of the totalEarned amount based on the user's custom point valuation diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningProgram.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningProgram.yml new file mode 100644 index 0000000..82a0f2e --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/earningProgram.yml @@ -0,0 +1,30 @@ +type: object +description: Reward earning data for the card +required: + - transactionLevelEarningScheme + - cardLevelEarningScheme +properties: + transactionLevelEarningScheme: + description: Grouped by earn rate, the rules that earn multipliers on each transaction + type: array + items: + $ref: ./earningContext.yml + cardLevelEarningScheme: + description: Card level bonuses, such as sign-on and anniversary bonuses + type: array + items: + $ref: ./earningBonus.yml + personalization: + description: Annual value of this card for the user, only returned in a simulation + type: object + properties: + totalSpent: + type: number + description: The amount the user spent in dollars within a calendar year + totalEarned: + type: number + description: The amount of points/miles/dollars the user would have received within a calendar year + totalValue: + type: number + description: The value in USD of the totalEarned amount based on the user's custom point valuation, minus fees + diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/merchantEarningItem.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/merchantEarningItem.yml new file mode 100644 index 0000000..07e1e71 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/earning-program/merchantEarningItem.yml @@ -0,0 +1,9 @@ +type: object +description: An association of an earn rate and a merchant +allOf: + - $ref: ./earningItem.yml + - type: object + properties: + merchant: + $ref: ../merchant.yml + description: the merchant of the item diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/fee.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/fee.yml new file mode 100644 index 0000000..731c928 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/fee.yml @@ -0,0 +1,22 @@ +type: object +description: A Fee +properties: + type: + $ref: ./feesEnum.yml + dollarValue: + type: number + percentageValue: + type: number + additive: + description: If true, the sum of dollar and percentage, else, the greater of the two + type: boolean + waivedInitially: + description: Is this waived when the card is opened + type: boolean + waivedMonths: + description: How long is it waived + type: number + description: + description: Additional Details + type: string + diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/feesEnum.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/feesEnum.yml new file mode 100644 index 0000000..29716d9 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/feesEnum.yml @@ -0,0 +1,7 @@ +type: string +enum: + - Annual Fee + - Foreign Transaction Fee + - Late Fee + - Other Fee + - Balance Transfer Fee diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/issuer.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/issuer.yml new file mode 100644 index 0000000..01ae723 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/issuer.yml @@ -0,0 +1,29 @@ +type: object +description: Private API will expose issuers (thats how we map to aggregators), this will return issuer name, logo and stuff, as well as rest reference to issuer API + UUID +properties: + uuid: + type: string + format: uuid + name: + type: string + image: + $ref: ./structures/image.yml + additionalDetails: + description: Internal values that may be helpful + type: object + properties: + popular: + type: boolean + description: Whether an institution is common + nickname: + type: string + description: What some users refer to the bank as instead of the full name + externalIdentifiers: + type: object + properties: + plaidId: + type: string + description: Plaid's identifier for this institution + finicityId: + type: integer + description: Finicity's identifier for this institution diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/merchant.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/merchant.yml new file mode 100644 index 0000000..6c21533 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/merchant.yml @@ -0,0 +1,14 @@ +type: object +description: A business or store that is affiliated with a credit card earning program +properties: + uuid: + type: string + format: uuid + name: + description: The merchant's name + type: string + logo: + type: string + description: Logo URL + category: + $ref: ./category.yml diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/network.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/network.yml new file mode 100644 index 0000000..6d1d3e1 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/network.yml @@ -0,0 +1,28 @@ +type: object +description: The payment network a card operates on +required: + - uuid + - type + - network +properties: + uuid: + type: string + format: uuid + type: + type: string + enum: + - store + - credit + level: + type: string + description: The level or package of the card on the network, such as world elite + image: + type: string + format: url + network: + description: The network or store lines providing credit + type: string + merchant: + $ref: ./merchant.yml + + diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/personalizationLevels.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/personalizationLevels.yml new file mode 100644 index 0000000..4ab51a3 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/personalizationLevels.yml @@ -0,0 +1,7 @@ +title: PersonalizationLevel +type: string +description: discriminator for If the card contains personalized details +enum: + - generic + - stale + - transactions diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/rate.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/rate.yml new file mode 100644 index 0000000..17a4f3a --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/rate.yml @@ -0,0 +1,17 @@ +type: object +description: An Interest Rate +properties: + minRate: + type: number + maxRate: + type: number + introRate: + description: Initial Rate + type: number + introLengthMonths: + description: How long is it low + type: number + description: + description: Additional Details + type: string + diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/rating.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/rating.yml new file mode 100644 index 0000000..a10275c --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/rating.yml @@ -0,0 +1,18 @@ +type: object +description: Overall rating of the card, with sub categories +properties: + overallRating: + description: Overall rating of the card, out of 5 + type: number + ratingComponents: + description: individual ratings of the card + type: array + items: + type: object + properties: + name: + description: Component Name + type: string + rating: + description: Component Rating, out of 5 + type: number diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/image.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/image.yml new file mode 100644 index 0000000..780efc8 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/image.yml @@ -0,0 +1,20 @@ +type: object +description: Defines an image +properties: + baseUrl: + type: string + format: url + originalFormat: + type: object + properties: + width: + type: number + height: + type: number + format: + type: string + primary: + type: boolean + supportsManipulation: + type: boolean + diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/link.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/link.yml new file mode 100644 index 0000000..7469c50 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/link.yml @@ -0,0 +1,25 @@ +type: object +description: A hyperlink +properties: + url: + type: string + format: url + description: The tracked redirect link flow + directUrl: + type: string + format: url + description: The raw url + type: + description: Where the link goes + type: string + enum: + - application + - terms + - profile + description: + description: More detail + type: string + primary: + description: Is this the converion link + type: boolean + diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/name.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/name.yml new file mode 100644 index 0000000..e8d3138 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/name.yml @@ -0,0 +1,12 @@ +type: object +description: A name, when multiple variations or aliases exist +properties: + value: + type: string + description: The value to display + primary: + type: boolean + description: Whether this is this primary name + details: + type: string + description: More Details diff --git a/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/timePeriod.yml b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/timePeriod.yml new file mode 100644 index 0000000..fde2862 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-core/schemas/structures/timePeriod.yml @@ -0,0 +1,14 @@ +type: object +description: A representation of an amount of time +properties: + length: + description: How long is the period in units + type: integer + unit: + type: string + enum: + - day + - week + - month + - quarter + - year diff --git a/Tests/Fixtures/acme/birch-catalog/birch-model/spec.yml b/Tests/Fixtures/acme/birch-catalog/birch-model/spec.yml new file mode 100644 index 0000000..3b05cfa --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-model/spec.yml @@ -0,0 +1,88 @@ +openapi: 3.0.3 +info: + title: atlas-model + description: >- + Provide an interface for all credit card and redemption program model + related data + version: 0.1.0 + contact: + name: Alex Whiteside + email: alex.whiteside@example.com +servers: + - url: 'https://api.onbirch.com/model' + description: Production + - url: 'https://dev.api.onbirch.com/model' + description: Development +components: + x-lint-skip: + - inline-schema-is-scalar + schemas: + CompactCreditCard: + $ref: ../atlas-core/schemas/credit-card/compactCreditCard.yml + CreditCard: + oneOf: + - $ref: ../atlas-core/schemas/credit-card/fullCreditCard.yml + - $ref: ../atlas-core/schemas/credit-card/compactCreditCard.yml + CreditCardRepresentation: + $ref: ../atlas-core/schemas/credit-card/creditCardRepresentations.yml + FullCreditCard: + $ref: ../atlas-core/schemas/credit-card/fullCreditCard.yml +tags: + - name: Credit Card +paths: + /cards: + get: + x-lint-skip: + - index-endpoint-has-limit + operationId: getAllCards + tags: + - Credit Card + summary: Get cards supported by Atlas + description: 'Returns Card and its metadata, additional details' + parameters: + - name: uuid + in: query + required: false + description: The UUID of the card(s) you want + schema: + type: string + format: uuid + - name: format + description: The level of detail you want (compact or full) + in: query + required: true + schema: + $ref: ../atlas-core/schemas/credit-card/creditCardRepresentations.yml + responses: + '200': + description: A compact array of cards available + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CreditCard' + '/cards/{uuid}': + get: + tags: + - Credit Card + operationId: getCardsById + summary: Get a specific credit card + description: Get a specific credit card + parameters: + - name: uuid + in: path + required: true + description: The UUID of the card you want + schema: + type: string + format: uuid + responses: + '200': + description: A credit card object + content: + application/json: + schema: + $ref: ../atlas-core/schemas/credit-card/fullCreditCard.yml + '404': + description: '`Card` with the given UUID does not exist' diff --git a/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/aggregatedSpending.yml b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/aggregatedSpending.yml new file mode 100644 index 0000000..c563194 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/aggregatedSpending.yml @@ -0,0 +1,23 @@ +type: object +description: A representation of a user's spending, aggregated over a period of time +properties: + aggregates: + type: array + items: + type: object + description: Individual spending groups + properties: + uuid: + description: A category, merchant or other spending group's uuid + type: string + format: uuid + amount: + description: A representation of how much (in value or relative) the user spent in this group + type: number + format: float + unit: + description: The unit of the values in spend aggregates + type: string + enum: + - usd + - none diff --git a/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/isolatedCardSimulationResponse.yml b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/isolatedCardSimulationResponse.yml new file mode 100644 index 0000000..05ce66c --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/isolatedCardSimulationResponse.yml @@ -0,0 +1,10 @@ +type: object +description: Result of an isolated card simulation +properties: + uuid: + type: string + format: uuid + cards: + type: array + items: + $ref: ../../atlas-core/schemas/credit-card/fullCreditCard.yml diff --git a/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/isolatedSimulationRequest.yml b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/isolatedSimulationRequest.yml new file mode 100644 index 0000000..0260b7c --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/isolatedSimulationRequest.yml @@ -0,0 +1,26 @@ +type: object +description: A request to get data about a simululation +required: + - cardUuids +properties: + cardUuids: + description: The card uuids to simulate - or null for all cards + type: array + items: + type: string + format: uuid + redemptionPreferences: + description: A user's indicated preferences about the rewards they would like to receive + type: array + items: + $ref: ./redemptionPreference.yml + aggregatedSpending: + $ref: ./aggregatedSpending.yml + allowTransferPartners: + description: Designates whether the user is willing to leverage transfer partners for higher redemption values + type: boolean + userProfile: + $ref: ./userProfile.yml + plaidAssetReportToken: + description: A Plaid Asset Report Token + type: string \ No newline at end of file diff --git a/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/plaidAssetReportDetail.yml b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/plaidAssetReportDetail.yml new file mode 100644 index 0000000..7ceb574 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/plaidAssetReportDetail.yml @@ -0,0 +1,38 @@ +type: object +description: Information about an asset report +required: + - dateGenerated + - dateReceived + - personalizationLevel +properties: + userUuid: + description: The uuid of a user to connect this token to + type: string + format: uuid + nullable: true + cardMatch: + type: array + items: + $ref: ../../atlas-core/schemas/cardMatch.yml + status: + description: The current status of the asset report within Atlas + readOnly: true + type: string + enum: + - syncing + - error + - ready + dateGenerated: + description: The date the asset report was created with Plaid + type: string + format: date + readOnly: true + dateReceived: + description: The date the asset report was submitted to Atlas + type: string + format: date + readOnly: true + personalizationLevel: + description: The personlization level acheived by this access token + readOnly: true + $ref: ../../atlas-core/schemas/personalizationLevels.yml diff --git a/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/redemptionPreference.yml b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/redemptionPreference.yml new file mode 100644 index 0000000..1c71707 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/redemptionPreference.yml @@ -0,0 +1,14 @@ +type: object +description: How a user feels about a particular way to redeem rewards +properties: + redemptionTypeUuid: + description: The UUID of a redemption type + type: string + format: uuid + weight: + description: The user's weight of the preference. > + -1 indicates the user would value this type of redemption at $0 + 0 indicates the user doesnt have a preference + Positive integers indicate a preference, which is normalized against other preferences + type: integer + format: int32 diff --git a/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/userProfile.yml b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/userProfile.yml new file mode 100644 index 0000000..1def1c6 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-simulator/schemas/userProfile.yml @@ -0,0 +1,19 @@ +type: object +description: Basic information about a user required for simulation +properties: + student: + type: boolean + description: Is the user a student? + military: + type: boolean + description: Is the user active duty military or an affiliate? + creditScore: + description: The user's credit score (or high end of a range) + type: integer + minimum: 400 + maximum: 850 + primaryAirport: + description: The user's primary airport or region, using IATA station codes + type: string + minLength: 3 + maxLength: 3 diff --git a/Tests/Fixtures/acme/birch-catalog/birch-simulator/spec.yml b/Tests/Fixtures/acme/birch-catalog/birch-simulator/spec.yml new file mode 100644 index 0000000..8181882 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-simulator/spec.yml @@ -0,0 +1,108 @@ +openapi: 3.0.3 +info: + title: atlas-simulator + description: Provide an interface for all credit card model related data + version: 1.0.0 + contact: + name: Alex Whiteside + email: alex.whiteside@example.com +servers: + - url: 'https://api.onbirch.com/simulator' + description: Production + - url: 'https://dev.api.onbirch.com/simulator' + description: Development +components: + x-lint-skip: + - inline-schema-is-scalar + schemas: + IsolatedCardSimulationResponse: + $ref: ./schemas/isolatedCardSimulationResponse.yml + IsolatedSimulationRequest: + $ref: ./schemas/isolatedSimulationRequest.yml + PlaidAssetReportDetail: + $ref: ./schemas/plaidAssetReportDetail.yml +tags: + - name: Plaid + - name: Simulation +paths: + /isolatedCardSimulations: + post: + summary: Simulate a card or group of cards in isolation from each other + tags: + - Credit Card + operationId: performAnIsolatedSimulation + requestBody: + content: + application/json: + schema: + $ref: ./schemas/isolatedSimulationRequest.yml + responses: + '200': + description: A simulation result containing simulations of the requested cards + content: + application/json: + schema: + $ref: ./schemas/isolatedCardSimulationResponse.yml + '400': + description: There was an error creating a simuluation from the request + '/data/plaidAssetReportTokens/{plaid_asset_report_token}': + parameters: + - name: plaid_asset_report_token + description: 'A Plaid Asset Report Token (plaid.com/docs/#assets)' + in: path + required: true + schema: + type: string + put: + summary: Ingests and processes a Plaid Asset Report Token + tags: + - Plaid + operationId: putPlaidAssetReportToken + requestBody: + content: + application/json: + schema: + $ref: ./schemas/plaidAssetReportDetail.yml + responses: + '200': + description: Token Updated + content: + application/json: + schema: + $ref: ./schemas/plaidAssetReportDetail.yml + '201': + description: Plaid Asset Report Token Accepted + content: + application/json: + schema: + $ref: ./schemas/plaidAssetReportDetail.yml + '400': + description: Request could not be processed + '404': + description: Token not found + get: + summary: Returns details about a Plaid Asset Report Token + tags: + - Plaid + operationId: getPlaidAssetReportToken + responses: + '200': + description: Returns details about the token + content: + application/json: + schema: + $ref: ./schemas/plaidAssetReportDetail.yml + '404': + description: Token not found + delete: + summary: >- + Deletes the Asset Report Token and all linked data, simulations, and + history. Cannot be undone. + tags: + - Plaid + operationId: deletePlaidAssetReportToken + responses: + '200': + description: Token Deleted + '404': + description: Token not found diff --git a/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankRequest.yml b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankRequest.yml new file mode 100644 index 0000000..4fd99a2 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankRequest.yml @@ -0,0 +1,8 @@ +type: object +description: A request to add new plaid bank +required: + - publicToken +properties: + publicToken: + description: User account (item) token received from Plaid + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankRequestMobile.yml b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankRequestMobile.yml new file mode 100644 index 0000000..7eda11f --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankRequestMobile.yml @@ -0,0 +1,12 @@ +type: object +description: Mobile request to add new plaid bank +required: + - publicToken + - token +properties: + publicToken: + description: User account (item) token received from Plaid + type: string + token: + description: Mobile User Token + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankResponse.yml b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankResponse.yml new file mode 100644 index 0000000..65b5a05 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankResponse.yml @@ -0,0 +1,12 @@ +type: object +description: Added account info +properties: + bankId: + description: Added BankAccount ID + type: string + accountIds: + description: Array of accountIDs + type: array + items: + type: string + description: Array of accountIDs diff --git a/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankResponseError.yml b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankResponseError.yml new file mode 100644 index 0000000..4ae72a3 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankResponseError.yml @@ -0,0 +1,10 @@ +type: object +required: + - message +properties: + message: + type: string + example: A server error occurred + details: + type: string + example: The server encountered an unexpected condition that prevented it from fulfilling the request. \ No newline at end of file diff --git a/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankResponseMobile.yml b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankResponseMobile.yml new file mode 100644 index 0000000..1878c74 --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/addBankResponseMobile.yml @@ -0,0 +1,6 @@ +type: object +description: Added account info +properties: + status: + description: Status of adding Bank Account + type: string diff --git a/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/getRateTableRequest.yml b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/getRateTableRequest.yml new file mode 100644 index 0000000..03303ea --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-web/schemas/getRateTableRequest.yml @@ -0,0 +1,13 @@ +type: object +required: + - productType +properties: + productType: + type: string + enum: + - credit_card + - loan + - savings + description: | + Type of Lead to return RateTable for. + \ No newline at end of file diff --git a/Tests/Fixtures/acme/birch-catalog/birch-web/spec.yml b/Tests/Fixtures/acme/birch-catalog/birch-web/spec.yml new file mode 100644 index 0000000..13a8d9b --- /dev/null +++ b/Tests/Fixtures/acme/birch-catalog/birch-web/spec.yml @@ -0,0 +1,182 @@ +openapi: 3.0.3 +info: + title: atlas-web + description: Atlas Web Application + version: 1.0.0 +servers: + - url: 'https://birchfinance.com/api' +components: + x-lint-skip: + - inline-schema-is-scalar + schemas: + AddBankResponse: + $ref: ./schemas/addBankResponse.yml + AddBankResponseMobile: + $ref: ./schemas/addBankResponseMobile.yml + AddBankRequest: + $ref: ./schemas/addBankRequest.yml + AddBankRequestMobile: + $ref: ./schemas/addBankRequestMobile.yml + GetRateTable: + $ref: ../originator/schemas/rateTablePublic.yml + GetRateTableRequest: + $ref: ./schemas/getRateTableRequest.yml + LeadRequestJson: + $ref: ../lead/schemas/leadRequestJson.yml + ApiError: + $ref: ../core/schemas/apiError.yml +tags: + - name: Plaid + - name: Bank +paths: + /plaid/addBanks: + post: + description: Add new Plaid bank connection + operationId: addBanks + tags: + - Plaid + requestBody: + content: + application/json: + schema: + $ref: ./schemas/addBankRequest.yml + responses: + '200': + description: Response containing sub accounts and user id + content: + application/json: + schema: + $ref: ./schemas/addBankResponse.yml + '400': + description: Bad Request + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + '500': + description: Internal server error + content: + application/json: + schema: + $ref: ../core/schemas/apiError.yml + example: + summary: An internal server error + description: An unknown error occured + value: + message: Internal Error + details: Something went wrong.. + /mobile/plaid/addBanks: + post: + description: Add new Plaid bank connection from Mobile + operationId: addBanksMobile + tags: + - Plaid + requestBody: + content: + application/json: + schema: + $ref: ./schemas/addBankRequestMobile.yml + responses: + '200': + description: Response containing status of adding Bank Account + content: + application/json: + schema: + $ref: ./schemas/addBankResponseMobile.yml + '400': + description: Bad Request + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + '401': + description: Not authorized + content: + application/json: + schema: + type: array + items: + $ref: ../core/schemas/apiError.yml + '500': + description: Internal server error + content: + application/json: + schema: + $ref: ../core/schemas/apiError.yml + example: + summary: An internal server error + description: An unknown error occured + value: + message: Internal Error + details: Something went wrong.. + /even/getRateTables: + post: + tags: + - Even + summary: getRateTables + description: getRateTables + operationId: getRateTables + requestBody: + description: Get `RateTable` for User by `productType` + content: + application/json: + schema: + $ref: ./schemas/getRateTableRequest.yml + required: true + responses: + '200': + description: >- + Returns `RateTable` for specified `productType` if table exists + within 30 days + content: + application/json: + schema: + $ref: ../originator/schemas/rateTablePublic.yml + '500': + description: Internal server error + content: + application/json: + schema: + $ref: ../core/schemas/apiError.yml + example: + summary: An internal server error + description: An unknown error occured + value: + message: Internal Error + details: Something went wrong... + /even/createUpdateLeadAndGetRateTables: + post: + tags: + - Even + summary: createUpdateLeadAndGetRateTables + operationId: createUpdateLeadAndGetRateTables + requestBody: + description: Create `Lead` and get `RateTable` + content: + application/json: + schema: + $ref: ../lead/schemas/leadRequestJson.yml + required: true + responses: + '200': + description: Return `RateTable` for newly created lead + content: + application/json: + schema: + $ref: ../originator/schemas/rateTablePublic.yml + '500': + description: Internal server error + content: + application/json: + schema: + $ref: ../core/schemas/apiError.yml + example: + summary: An internal server error + description: An unknown error occured + value: + message: Internal Error + details: Something went wrong.. diff --git a/Tests/Fixtures/acme/zephyr-data/bundled.yml b/Tests/Fixtures/acme/zephyr-data/bundled.yml new file mode 100644 index 0000000..b8bea27 --- /dev/null +++ b/Tests/Fixtures/acme/zephyr-data/bundled.yml @@ -0,0 +1,77 @@ +openapi: 3.0.3 +info: + title: ACME Zephyr Data + description: >- + Synthetic bundled OpenAPI fixture representing the output of a downstream + Stitcher-style reference resolver. + version: 2.7.3-rc.0 +servers: + - url: "https://api.example.com/zephyr-data" +paths: + /activeZorplexFeatures: + get: + summary: Get active zorplex features + operationId: getActiveZorplexFeatures + responses: + "200": + description: Active features found + content: + application/json: + schema: + type: array + items: + type: object + required: + - id + - uuid + - subAccountId + - feature + properties: + id: + type: integer + format: int64 + uuid: + type: string + format: uuid + subAccountId: + type: integer + format: int64 + feature: + type: string + enum: + - QUANTUM_FLURBINATION + - GRIBBLE_ENHANCEMENT + - BLARF_OPTIMIZATION +components: + schemas: + ActiveZorplexFeature: + type: object + required: + - id + - uuid + - subAccountId + - feature + - createdAt + - createdBy + properties: + id: + type: integer + format: int64 + uuid: + type: string + format: uuid + subAccountId: + type: integer + format: int64 + feature: + type: string + enum: + - QUANTUM_FLURBINATION + - GRIBBLE_ENHANCEMENT + - BLARF_OPTIMIZATION + - FNORD_ACCELERATION + - QUASAR_MATRIX_V2 + deletedAt: + type: string + format: date-time + nullable: true diff --git a/Tests/Fixtures/acme/zephyr-data/schemas/activeZorplexFeature.yml b/Tests/Fixtures/acme/zephyr-data/schemas/activeZorplexFeature.yml new file mode 100644 index 0000000..dae3436 --- /dev/null +++ b/Tests/Fixtures/acme/zephyr-data/schemas/activeZorplexFeature.yml @@ -0,0 +1,40 @@ +type: object +description: Represents an active blixnart feature on a zorplex entity +required: + - id + - uuid + - subAccountId + - feature + - createdAt + - createdBy +properties: + id: + type: integer + format: int64 + description: Unique flurbinator identifier + example: 42 + uuid: + type: string + format: uuid + description: Universal gribble identifier + example: 550e8400-e29b-41d4-a716-446655440000 + subAccountId: + type: integer + format: int64 + description: Associated zorplex sub-account + example: 1337 + feature: + $ref: ./zorplexFeature.yml + createdAt: + type: string + format: date-time + description: When the quasar was fnordicated + createdBy: + type: string + format: uuid + description: Who performed the blarf activation + deletedAt: + type: string + format: date-time + description: When the flurbination was terminated + nullable: true diff --git a/Tests/Fixtures/acme/zephyr-data/schemas/zorplexFeature.yml b/Tests/Fixtures/acme/zephyr-data/schemas/zorplexFeature.yml new file mode 100644 index 0000000..ed027fd --- /dev/null +++ b/Tests/Fixtures/acme/zephyr-data/schemas/zorplexFeature.yml @@ -0,0 +1,8 @@ +type: string +description: Available synthetic features for a zorplex entity +enum: + - QUANTUM_FLURBINATION + - GRIBBLE_ENHANCEMENT + - BLARF_OPTIMIZATION + - FNORD_ACCELERATION + - QUASAR_MATRIX_V2 diff --git a/Tests/Fixtures/acme/zephyr-data/spec.yml b/Tests/Fixtures/acme/zephyr-data/spec.yml new file mode 100644 index 0000000..1e08d9e --- /dev/null +++ b/Tests/Fixtures/acme/zephyr-data/spec.yml @@ -0,0 +1,61 @@ +openapi: 3.0.3 +info: + title: ACME Zephyr Data + description: >- + Synthetic multi-file OpenAPI fixture modeled after downstream Stitcher + inputs with folded text, relative references, and nested schemas. + version: 2.7.3-rc.0 + contact: + name: Quasar Team + url: >- + https://example.com/docs/zorplex-fnordication +servers: + - url: "https://api.example.com/zephyr-data" + description: Prod + - url: "https://dev-api.example.com/zephyr-data" + description: Dev +tags: + - name: Active Zorplex Features + description: | + Features currently active for a zorplex account. +components: + securitySchemes: + internal: + type: http + scheme: bearer + schemas: + ActiveZorplexFeature: + $ref: ./schemas/activeZorplexFeature.yml + ZorplexFeature: + $ref: ./schemas/zorplexFeature.yml +security: + - internal: [] +paths: + /activeZorplexFeatures: + get: + summary: Get active zorplex features + operationId: getActiveZorplexFeatures + tags: + - Active Zorplex Features + parameters: + - name: zorplexSubAccountId + in: query + required: true + description: A comma separated list of zorplex sub-account ids + schema: + type: array + items: + type: integer + format: int64 + minimum: 1 + style: form + explode: false + responses: + "200": + description: Active features found + content: + application/json: + schema: + type: array + items: + $ref: ./schemas/activeZorplexFeature.yml