diff --git a/.trigger b/.trigger new file mode 100644 index 0000000..8d52ed3 --- /dev/null +++ b/.trigger @@ -0,0 +1 @@ +# Trigger reanalysis 20:27:09 diff --git a/README.md b/README.md index 908bdb1..5272986 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # demo Demo repository for CodeRifts API governance +# Generator detection trigger + diff --git a/api/openapi.yaml b/api/openapi.yaml index a378b85..08f941d 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -1,7 +1,7 @@ openapi: "3.0.3" info: title: Acme API - version: "1.4.0" + version: "2.0.0" paths: /users/{id}: get: @@ -99,8 +99,6 @@ paths: post: summary: Charge payment operationId: chargePayment - security: - - bearerAuth: [] requestBody: required: true content: @@ -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 @@ -144,6 +127,7 @@ paths: required: - url - events + - secret properties: url: type: string @@ -151,16 +135,33 @@ paths: 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: @@ -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 @@ -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: @@ -239,6 +248,7 @@ components: required: - user_id - items + - shipping_address properties: user_id: type: string @@ -246,6 +256,8 @@ components: type: array items: $ref: "#/components/schemas/OrderItem" + shipping_address: + type: string ChargeRequest: type: object required: @@ -281,3 +293,12 @@ components: type: string amount: type: number + + + + + + + + + diff --git a/src/checkout.js b/src/checkout.js new file mode 100644 index 0000000..f0f7b1d --- /dev/null +++ b/src/checkout.js @@ -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