Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
markxiong0122 committed Sep 16, 2024
2 parents a8109df + 9fcb27f commit 11eeb01
Show file tree
Hide file tree
Showing 201 changed files with 22,839 additions and 3,334 deletions.
35 changes: 35 additions & 0 deletions framework/basehandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import settings
from api import api_specs
<<<<<<< HEAD
from framework import csp
from framework import permissions
from framework import secrets
Expand All @@ -44,13 +45,38 @@
OT_ACTIVATION_FAILED,
OT_CREATION_FAILED,
OT_READY_FOR_CREATION)
||||||| 76d0ce7e
from framework import csp
from framework import permissions
from framework import secrets
from framework import users
from framework import utils
from framework import xsrf
from internals import approval_defs
from internals import notifier_helpers
from internals.core_enums import ALL_ORIGIN_TRIAL_STAGE_TYPES
=======
from framework import csp, permissions, secrets, users, utils, xsrf
from internals import approval_defs, notifier_helpers, user_models
from internals.core_enums import ALL_ORIGIN_TRIAL_STAGE_TYPES
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
from internals.core_models import FeatureEntry, MilestoneSet, Stage
from internals.data_types import CHANGED_FIELDS_LIST_TYPE
<<<<<<< HEAD

from flask import session
from flask import render_template
from flask_cors import CORS
from gen.py.chromestatus_openapi.chromestatus_openapi.models.base_model import Model
||||||| 76d0ce7e
from internals import user_models

from flask import session
from flask import render_template
from flask_cors import CORS
from gen.py.chromestatus_openapi.chromestatus_openapi.models.base_model import Model
=======
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d

# Our API responses are prefixed with this ro prevent attacks that
# exploit <script src="...">. See go/xssi.
Expand Down Expand Up @@ -198,10 +224,19 @@ def get(self, *args, **kwargs):
"""Handle an incoming HTTP GET request."""
headers = self.get_headers()
handler_data = self.do_get(*args, **kwargs)
<<<<<<< HEAD
# OpenAPI models have a to_dict attribute that should be used for
# converting to JSON.
if hasattr(handler_data, 'to_dict'):
handler_data = handler_data.to_dict()
||||||| 76d0ce7e
if isinstance(handler_data, Model):
handler_data = handler_data.to_dict()
=======
to_dict_op = getattr(handler_data, "to_dict", None)
if callable(to_dict_op):
handler_data = handler_data.to_dict()
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
return self.defensive_jsonify(handler_data), headers

def post(self, *args, **kwargs):
Expand Down
16 changes: 16 additions & 0 deletions gen/js/chromestatus-openapi/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ src/models/FeatureLink.ts
src/models/FeatureLinksResponse.ts
src/models/FeatureLinksSample.ts
src/models/FeatureLinksSummaryResponse.ts
<<<<<<< HEAD
src/models/FeatureSearchResponse.ts
src/models/FieldInfo.ts
src/models/Gate.ts
src/models/GateInfo.ts
||||||| 76d0ce7e
=======
src/models/FeatureSearchResponse.ts
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
src/models/GateLatency.ts
src/models/GetCommentsResponse.ts
src/models/GetDismissedCues400Response.ts
Expand Down Expand Up @@ -85,15 +90,26 @@ src/models/ReviewLatency.ts
src/models/SetStarRequest.ts
src/models/SignInRequest.ts
src/models/SpecMentor.ts
<<<<<<< HEAD
src/models/StageDict.ts
src/models/StageDictExtension.ts
src/models/StageField.ts
src/models/StringFieldInfoValue.ts
||||||| 76d0ce7e
=======
src/models/StageDict.ts
src/models/StageDictExtension.ts
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
src/models/SuccessMessage.ts
src/models/TokenRefreshResponse.ts
src/models/UserPermissions.ts
<<<<<<< HEAD
src/models/VerboseFeatureDict.ts
src/models/Vote.ts
||||||| 76d0ce7e
=======
src/models/VerboseFeatureDict.ts
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
src/models/index.ts
src/runtime.ts
tsconfig.esm.json
Expand Down
162 changes: 162 additions & 0 deletions gen/js/chromestatus-openapi/src/apis/DefaultApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ import type {
FeatureLinksResponse,
FeatureLinksSample,
FeatureLinksSummaryResponse,
<<<<<<< HEAD
FeatureSearchResponse,
GetCommentsResponse,
||||||| 76d0ce7e
=======
FeatureSearchResponse,
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
GetDismissedCues400Response,
GetGateResponse,
GetIntentResponse,
Expand Down Expand Up @@ -86,10 +91,16 @@ import {
FeatureLinksSampleToJSON,
FeatureLinksSummaryResponseFromJSON,
FeatureLinksSummaryResponseToJSON,
<<<<<<< HEAD
FeatureSearchResponseFromJSON,
FeatureSearchResponseToJSON,
GetCommentsResponseFromJSON,
GetCommentsResponseToJSON,
||||||| 76d0ce7e
=======
FeatureSearchResponseFromJSON,
FeatureSearchResponseToJSON,
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
GetDismissedCues400ResponseFromJSON,
GetDismissedCues400ResponseToJSON,
GetGateResponseFromJSON,
Expand Down Expand Up @@ -180,6 +191,7 @@ export interface DismissCueOperationRequest {
dismissCueRequest: DismissCueRequest;
}

<<<<<<< HEAD
export interface ExtendOriginTrialRequest {
featureId: number;
extensionStageId: number;
Expand All @@ -202,6 +214,22 @@ export interface GetFeatureCommentsRequest {
featureId: number;
}

||||||| 76d0ce7e
=======
export interface GetAllFeaturesRequest {
q?: string;
sort?: string;
num?: number;
start?: number;
milestone?: number;
releaseNotesMilestone?: number;
}

export interface GetFeatureByIdRequest {
featureId: number;
}

>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
export interface GetFeatureLinksRequest {
featureId?: number;
updateStaleLinks?: boolean;
Expand Down Expand Up @@ -452,6 +480,7 @@ export interface DefaultApiInterface {

/**
*
<<<<<<< HEAD
* @summary Extend an existing origin trial
* @param {number} featureId
* @param {number} extensionStageId
Expand Down Expand Up @@ -488,6 +517,29 @@ export interface DefaultApiInterface {

/**
*
||||||| 76d0ce7e
=======
* @summary retrive a list of feature
* @param {string} [q] Search query string.
* @param {string} [sort] Sorting specification.
* @param {number} [num] Number of results to return.
* @param {number} [start] Index of the first result to return.
* @param {number} [milestone] Filter features by milestone.
* @param {number} [releaseNotesMilestone] Filter features by release notes milestone.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DefaultApiInterface
*/
getAllFeaturesRaw(requestParameters: GetAllFeaturesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FeatureSearchResponse>>;

/**
* retrive a list of feature
*/
getAllFeatures(requestParameters: GetAllFeaturesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FeatureSearchResponse>;

/**
*
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
* @summary Get dismissed cues for the current user
* @param {*} [options] Override http request option.
* @throws {RequiredError}
Expand All @@ -502,6 +554,7 @@ export interface DefaultApiInterface {

/**
*
<<<<<<< HEAD
* @summary Get a feature by ID
* @param {number} featureId ID of the feature to retrieve
* @param {*} [options] Override http request option.
Expand Down Expand Up @@ -532,6 +585,24 @@ export interface DefaultApiInterface {

/**
*
||||||| 76d0ce7e
=======
* @summary Get a feature by ID
* @param {number} featureId ID of the feature to retrieve
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DefaultApiInterface
*/
getFeatureByIdRaw(requestParameters: GetFeatureByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerboseFeatureDict>>;

/**
* Get a feature by ID
*/
getFeatureById(requestParameters: GetFeatureByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerboseFeatureDict>;

/**
*
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
* @summary Get feature links by feature_id
* @param {number} [featureId]
* @param {boolean} [updateStaleLinks]
Expand Down Expand Up @@ -1352,6 +1423,7 @@ export class DefaultApi extends runtime.BaseAPI implements DefaultApiInterface {
}

/**
<<<<<<< HEAD
* Extend an existing origin trial
*/
async extendOriginTrialRaw(requestParameters: ExtendOriginTrialRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessMessage>> {
Expand Down Expand Up @@ -1442,6 +1514,59 @@ export class DefaultApi extends runtime.BaseAPI implements DefaultApiInterface {
}

/**
||||||| 76d0ce7e
=======
* retrive a list of feature
*/
async getAllFeaturesRaw(requestParameters: GetAllFeaturesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FeatureSearchResponse>> {
const queryParameters: any = {};

if (requestParameters['q'] != null) {
queryParameters['q'] = requestParameters['q'];
}

if (requestParameters['sort'] != null) {
queryParameters['sort'] = requestParameters['sort'];
}

if (requestParameters['num'] != null) {
queryParameters['num'] = requestParameters['num'];
}

if (requestParameters['start'] != null) {
queryParameters['start'] = requestParameters['start'];
}

if (requestParameters['milestone'] != null) {
queryParameters['milestone'] = requestParameters['milestone'];
}

if (requestParameters['releaseNotesMilestone'] != null) {
queryParameters['releaseNotesMilestone'] = requestParameters['releaseNotesMilestone'];
}

const headerParameters: runtime.HTTPHeaders = {};

const response = await this.request({
path: `/features`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => FeatureSearchResponseFromJSON(jsonValue));
}

/**
* retrive a list of feature
*/
async getAllFeatures(requestParameters: GetAllFeaturesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FeatureSearchResponse> {
const response = await this.getAllFeaturesRaw(requestParameters, initOverrides);
return await response.value();
}

/**
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
* Get dismissed cues for the current user
*/
async getDismissedCuesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<string>>> {
Expand All @@ -1468,6 +1593,7 @@ export class DefaultApi extends runtime.BaseAPI implements DefaultApiInterface {
}

/**
<<<<<<< HEAD
* Get a feature by ID
*/
async getFeatureByIdRaw(requestParameters: GetFeatureByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerboseFeatureDict>> {
Expand Down Expand Up @@ -1534,6 +1660,42 @@ export class DefaultApi extends runtime.BaseAPI implements DefaultApiInterface {
}

/**
||||||| 76d0ce7e
=======
* Get a feature by ID
*/
async getFeatureByIdRaw(requestParameters: GetFeatureByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerboseFeatureDict>> {
if (requestParameters['featureId'] == null) {
throw new runtime.RequiredError(
'featureId',
'Required parameter "featureId" was null or undefined when calling getFeatureById().'
);
}

const queryParameters: any = {};

const headerParameters: runtime.HTTPHeaders = {};

const response = await this.request({
path: `/features/{feature_id}`.replace(`{${"feature_id"}}`, encodeURIComponent(String(requestParameters['featureId']))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => VerboseFeatureDictFromJSON(jsonValue));
}

/**
* Get a feature by ID
*/
async getFeatureById(requestParameters: GetFeatureByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerboseFeatureDict> {
const response = await this.getFeatureByIdRaw(requestParameters, initOverrides);
return await response.value();
}

/**
>>>>>>> 9fcb27fe87d90d342617429deb845522889ce21d
* Get feature links by feature_id
*/
async getFeatureLinksRaw(requestParameters: GetFeatureLinksRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FeatureLinksResponse>> {
Expand Down
Loading

0 comments on commit 11eeb01

Please sign in to comment.