Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Trigger reanalysis 20:27:09
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# demo
Demo repository for CodeRifts API governance
# Generator detection trigger

79 changes: 50 additions & 29 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: "3.0.3"
info:
title: Acme API
version: "1.4.0"
version: "2.0.0"
paths:
/users/{id}:
get:
Expand Down Expand Up @@ -99,8 +99,6 @@ paths:
post:
summary: Charge payment
operationId: chargePayment
security:
- bearerAuth: []
requestBody:
required: true
content:
Expand All @@ -114,21 +112,6 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/PaymentResult"
/payments/refund:
post:
summary: Refund payment
operationId: refundPayment
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/RefundRequest"
responses:
"200":
description: Refund processed
/webhooks/subscribe:
post:
summary: Subscribe to webhooks
Expand All @@ -144,23 +127,41 @@ paths:
required:
- url
- events
- secret
properties:
url:
type: string
events:
type: array
items:
type: string
secret:
type: string
responses:
"201":
description: Subscribed
/internal/health:
get:
summary: Health check
operationId: healthCheck
/users/{id}/avatar:
put:
summary: Upload user avatar
operationId: uploadAvatar
security:
- bearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
image/png:
schema:
type: string
format: binary
responses:
"200":
description: OK
description: Avatar updated
components:
securitySchemes:
bearerAuth:
Expand All @@ -173,29 +174,37 @@ components:
- id
- email
- name
- role
properties:
id:
type: string
email:
type: string
type: object
properties:
address:
type: string
verified:
type: boolean
name:
type: string
phone:
type: string
created_at:
type: string
format: date-time
role:
type: string
enum: [admin, user, moderator]
CreateUserRequest:
type: object
required:
- email
- name
- role
properties:
email:
type: string
name:
type: string
phone:
role:
type: string
Order:
type: object
Expand All @@ -210,13 +219,13 @@ components:
user_id:
type: string
total:
type: number
type: string
currency:
type: string
default: "USD"
status:
type: string
enum: [pending, confirmed, shipped, delivered]
enum: [pending, confirmed, delivered]
items:
type: array
items:
Expand All @@ -239,13 +248,16 @@ components:
required:
- user_id
- items
- shipping_address
properties:
user_id:
type: string
items:
type: array
items:
$ref: "#/components/schemas/OrderItem"
shipping_address:
type: string
ChargeRequest:
type: object
required:
Expand Down Expand Up @@ -281,3 +293,12 @@ components:
type: string
amount:
type: number









34 changes: 34 additions & 0 deletions src/checkout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Feature flags in production code
const featureFlags = require('./flags');

function processCheckout(cart) {
if (featureFlags.isEnabled('new-checkout-flow')) {
return newCheckoutFlow(cart);
}

if (process.env.FEATURE_DARK_MODE === 'true') {
applyDarkTheme();
}

if (featureFlags.isEnabled('beta-payment-gateway')) {
return betaPayment(cart);
}

// Old flag that should have been cleaned up
if (featureFlags.isEnabled('holiday-promo-2024')) {
applyHolidayDiscount(cart);
}

if (process.env.FF_ENABLE_ANALYTICS === 'true') {
trackCheckout(cart);
}
}

module.exports = { processCheckout };
// trigger
// flag scan trigger 1771972309
// v3 flag fix trigger 1771972703
// canary test 1771973319
// canary2 1771973550
// debug-info 1771973777
// v4 octokit-request fix trigger 1771974320