@azure-rest/onlineexperimentation 1.0.0-alpha.20250807.2 → 1.0.0-alpha.20250822.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/clientDefinitions.d.ts +1 -0
- package/dist/browser/clientDefinitions.js +1 -0
- package/dist/browser/clientDefinitions.js.map +1 -0
- package/dist/browser/extensibleEnums.d.ts +1 -0
- package/dist/browser/extensibleEnums.js +1 -0
- package/dist/browser/extensibleEnums.js.map +1 -0
- package/dist/browser/index.d.ts +1 -0
- package/dist/browser/index.js +1 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/isUnexpected.d.ts +1 -0
- package/dist/browser/isUnexpected.js +1 -0
- package/dist/browser/isUnexpected.js.map +1 -0
- package/dist/browser/logger.d.ts +1 -0
- package/dist/browser/logger.js +1 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/models.d.ts +1 -0
- package/dist/browser/models.js +1 -0
- package/dist/browser/models.js.map +1 -0
- package/dist/browser/onlineExperimentationClient.d.ts +1 -0
- package/dist/browser/onlineExperimentationClient.js +1 -0
- package/dist/browser/onlineExperimentationClient.js.map +1 -0
- package/dist/browser/outputModels.d.ts +1 -0
- package/dist/browser/outputModels.js +1 -0
- package/dist/browser/outputModels.js.map +1 -0
- package/dist/browser/paginateHelper.d.ts +1 -0
- package/dist/browser/paginateHelper.js +1 -0
- package/dist/browser/paginateHelper.js.map +1 -0
- package/dist/browser/parameters.d.ts +1 -0
- package/dist/browser/parameters.js +1 -0
- package/dist/browser/parameters.js.map +1 -0
- package/dist/browser/responses.d.ts +1 -0
- package/dist/browser/responses.js +1 -0
- package/dist/browser/responses.js.map +1 -0
- package/dist/commonjs/clientDefinitions.d.ts +1 -0
- package/dist/commonjs/clientDefinitions.js +1 -0
- package/dist/commonjs/clientDefinitions.js.map +1 -0
- package/dist/commonjs/extensibleEnums.d.ts +1 -0
- package/dist/commonjs/extensibleEnums.js +1 -0
- package/dist/commonjs/extensibleEnums.js.map +1 -0
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +12 -27
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/isUnexpected.d.ts +1 -0
- package/dist/commonjs/isUnexpected.js +1 -0
- package/dist/commonjs/isUnexpected.js.map +1 -0
- package/dist/commonjs/logger.d.ts +1 -0
- package/dist/commonjs/logger.js +1 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/models.d.ts +1 -0
- package/dist/commonjs/models.js +1 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/onlineExperimentationClient.d.ts +1 -0
- package/dist/commonjs/onlineExperimentationClient.js +1 -0
- package/dist/commonjs/onlineExperimentationClient.js.map +1 -0
- package/dist/commonjs/outputModels.d.ts +1 -0
- package/dist/commonjs/outputModels.js +1 -0
- package/dist/commonjs/outputModels.js.map +1 -0
- package/dist/commonjs/paginateHelper.d.ts +1 -0
- package/dist/commonjs/paginateHelper.js +1 -0
- package/dist/commonjs/paginateHelper.js.map +1 -0
- package/dist/commonjs/parameters.d.ts +1 -0
- package/dist/commonjs/parameters.js +1 -0
- package/dist/commonjs/parameters.js.map +1 -0
- package/dist/commonjs/responses.d.ts +1 -0
- package/dist/commonjs/responses.js +1 -0
- package/dist/commonjs/responses.js.map +1 -0
- package/dist/esm/clientDefinitions.d.ts +1 -0
- package/dist/esm/clientDefinitions.js +1 -0
- package/dist/esm/clientDefinitions.js.map +1 -0
- package/dist/esm/extensibleEnums.d.ts +1 -0
- package/dist/esm/extensibleEnums.js +1 -0
- package/dist/esm/extensibleEnums.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isUnexpected.d.ts +1 -0
- package/dist/esm/isUnexpected.js +1 -0
- package/dist/esm/isUnexpected.js.map +1 -0
- package/dist/esm/logger.d.ts +1 -0
- package/dist/esm/logger.js +1 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models.d.ts +1 -0
- package/dist/esm/models.js +1 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/onlineExperimentationClient.d.ts +1 -0
- package/dist/esm/onlineExperimentationClient.js +1 -0
- package/dist/esm/onlineExperimentationClient.js.map +1 -0
- package/dist/esm/outputModels.d.ts +1 -0
- package/dist/esm/outputModels.js +1 -0
- package/dist/esm/outputModels.js.map +1 -0
- package/dist/esm/paginateHelper.d.ts +1 -0
- package/dist/esm/paginateHelper.js +1 -0
- package/dist/esm/paginateHelper.js.map +1 -0
- package/dist/esm/parameters.d.ts +1 -0
- package/dist/esm/parameters.js +1 -0
- package/dist/esm/parameters.js.map +1 -0
- package/dist/esm/responses.d.ts +1 -0
- package/dist/esm/responses.js +1 -0
- package/dist/esm/responses.js.map +1 -0
- package/dist/react-native/clientDefinitions.d.ts +1 -0
- package/dist/react-native/clientDefinitions.js +1 -0
- package/dist/react-native/clientDefinitions.js.map +1 -0
- package/dist/react-native/extensibleEnums.d.ts +1 -0
- package/dist/react-native/extensibleEnums.js +1 -0
- package/dist/react-native/extensibleEnums.js.map +1 -0
- package/dist/react-native/index.d.ts +1 -0
- package/dist/react-native/index.js +1 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/isUnexpected.d.ts +1 -0
- package/dist/react-native/isUnexpected.js +1 -0
- package/dist/react-native/isUnexpected.js.map +1 -0
- package/dist/react-native/logger.d.ts +1 -0
- package/dist/react-native/logger.js +1 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models.d.ts +1 -0
- package/dist/react-native/models.js +1 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/onlineExperimentationClient.d.ts +1 -0
- package/dist/react-native/onlineExperimentationClient.js +1 -0
- package/dist/react-native/onlineExperimentationClient.js.map +1 -0
- package/dist/react-native/outputModels.d.ts +1 -0
- package/dist/react-native/outputModels.js +1 -0
- package/dist/react-native/outputModels.js.map +1 -0
- package/dist/react-native/paginateHelper.d.ts +1 -0
- package/dist/react-native/paginateHelper.js +1 -0
- package/dist/react-native/paginateHelper.js.map +1 -0
- package/dist/react-native/parameters.d.ts +1 -0
- package/dist/react-native/parameters.js +1 -0
- package/dist/react-native/parameters.js.map +1 -0
- package/dist/react-native/responses.d.ts +1 -0
- package/dist/react-native/responses.js +1 -0
- package/dist/react-native/responses.js.map +1 -0
- package/package.json +41 -40
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetMetricParameters,\n CreateOrUpdateMetricParameters,\n DeleteMetricParameters,\n ValidateMetricParameters,\n ListMetricsParameters,\n} from \"./parameters.js\";\nimport type {\n GetMetric200Response,\n GetMetricDefaultResponse,\n CreateOrUpdateMetric200Response,\n CreateOrUpdateMetric201Response,\n CreateOrUpdateMetricDefaultResponse,\n DeleteMetric204Response,\n DeleteMetricDefaultResponse,\n ValidateMetric200Response,\n ValidateMetricDefaultResponse,\n ListMetrics200Response,\n ListMetricsDefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetMetric {\n /** Fetches an experiment metric by ID. */\n get(\n options?: GetMetricParameters,\n ): StreamableMethod<GetMetric200Response | GetMetricDefaultResponse>;\n /** Creates or updates an experiment metric. */\n patch(\n options: CreateOrUpdateMetricParameters,\n ): StreamableMethod<\n | CreateOrUpdateMetric200Response\n | CreateOrUpdateMetric201Response\n | CreateOrUpdateMetricDefaultResponse\n >;\n /** Deletes an experiment metric. */\n delete(\n options?: DeleteMetricParameters,\n ): StreamableMethod<DeleteMetric204Response | DeleteMetricDefaultResponse>;\n}\n\nexport interface ValidateMetric {\n /** Validates an experiment metric definition. */\n post(\n options: ValidateMetricParameters,\n ): StreamableMethod<ValidateMetric200Response | ValidateMetricDefaultResponse>;\n}\n\nexport interface ListMetrics {\n /** Lists experiment metrics. */\n get(\n options?: ListMetricsParameters,\n ): StreamableMethod<ListMetrics200Response | ListMetricsDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/experiment-metrics/\\{experimentMetricId\\}' has methods for the following verbs: get, patch, delete */\n (path: \"/experiment-metrics/{experimentMetricId}\", experimentMetricId: string): GetMetric;\n /** Resource for '/experiment-metrics:validate' has methods for the following verbs: post */\n (path: \"/experiment-metrics:validate\"): ValidateMetric;\n /** Resource for '/experiment-metrics' has methods for the following verbs: get */\n (path: \"/experiment-metrics\"): ListMetrics;\n}\n\nexport type OnlineExperimentationClient = Client & {\n path: Routes;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensibleEnums.js","sourceRoot":"","sources":["../../src/extensibleEnums.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAN,IAAY,qBAeX;AAfD,WAAY,qBAAqB;IAC/B;;OAEG;IACH,8CAAqB,CAAA;IAErB;;OAEG;IACH,8CAAqB,CAAA;IAErB;;OAEG;IACH,4CAAmB,CAAA;AACrB,CAAC,EAfW,qBAAqB,KAArB,qBAAqB,QAehC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,yBAmCX;AAnCD,WAAY,yBAAyB;IACnC;;OAEG;IACH,sDAAyB,CAAA;IAEzB;;OAEG;IACH,oDAAuB,CAAA;IAEvB;;OAEG;IACH,oDAAuB,CAAA;IAEvB;;OAEG;IACH,kDAAqB,CAAA;IAErB;;OAEG;IACH,wCAAW,CAAA;IAEX;;OAEG;IACH,gDAAmB,CAAA;IAEnB;;OAEG;IACH,sDAAyB,CAAA;AAC3B,CAAC,EAnCW,yBAAyB,KAAzB,yBAAyB,QAmCpC;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC7B;;OAEG;IACH,wCAAiB,CAAA;IAEjB;;OAEG;IACH,4CAAqB,CAAA;AACvB,CAAC,EAVW,mBAAmB,KAAnB,mBAAmB,QAU9B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,mBAsBX;AAtBD,WAAY,mBAAmB;IAC7B;;OAEG;IACH,wEAAiD,CAAA;IAEjD;;OAEG;IACH,sEAA+C,CAAA;IAE/C;;OAEG;IACH,8EAAuD,CAAA;IAEvD;;;;OAIG;IACH,8FAAuE,CAAA;AACzE,CAAC,EAtBW,mBAAmB,KAAnB,mBAAmB,QAsB9B;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,qBAUX;AAVD,WAAY,qBAAqB;IAC/B;;OAEG;IACH,wCAAe,CAAA;IAEf;;OAEG;IACH,4CAAmB,CAAA;AACrB,CAAC,EAVW,qBAAqB,KAArB,qBAAqB,QAUhC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Desired direction for an experiment metric value.\n */\nexport enum KnownDesiredDirection {\n /**\n * An increase to the metric value is desired. E.g., Success rate, Total revenue.\n */\n Increase = \"Increase\",\n\n /**\n * A decrease to the metric value is desired. E.g., Error rate, Latency.\n */\n Decrease = \"Decrease\",\n\n /**\n * Neither an increase nor a decrease to the metric value is desired, or the desired direction depends on other factors. E.g., Number of video play attempts, Number of user feedbacks\n */\n Neutral = \"Neutral\",\n}\n\n/**\n * How the metric definition calculates metric values from event data.\n */\nexport enum KnownExperimentMetricType {\n /**\n * Counts the occurrences of an event. Experiment analysis accounts for unequal traffic allocation.\n */\n EventCount = \"EventCount\",\n\n /**\n * Counts the number of unique users who encounter an event. Experiment analysis accounts for unequal traffic allocation.\n */\n UserCount = \"UserCount\",\n\n /**\n * Calculates the percentage of events that satisfy a specified condition.\n */\n EventRate = \"EventRate\",\n\n /**\n * Calculates the percentage of users who encounter a start event and subsequently encounter an end event. Users must encounter the start event before the end event to be counted.\n */\n UserRate = \"UserRate\",\n\n /**\n * Calculates the sum of a specified event property. Experiment analysis accounts for unequal traffic allocation.\n */\n Sum = \"Sum\",\n\n /**\n * Calculates the average value of a specified event property.\n */\n Average = \"Average\",\n\n /**\n * Calculates a specified percentile of an event property.\n */\n Percentile = \"Percentile\",\n}\n\n/**\n * Lifecycle stages of an experiment metric, determining whether the metric is included in experiment analysis.\n */\nexport enum KnownLifecycleStage {\n /**\n * The metric is included in experiment analysis.\n */\n Active = \"Active\",\n\n /**\n * The metric is excluded from experiment analysis but remains available for future use.\n */\n Inactive = \"Inactive\",\n}\n\n/**\n * The diagnostic error codes.\n */\nexport enum KnownDiagnosticCode {\n /**\n * The metric definition does not conform to the JSON schema.\n */\n FailedSchemaValidation = \"FailedSchemaValidation\",\n\n /**\n * The event filter condition is invalid.\n */\n InvalidEventCondition = \"InvalidEventCondition\",\n\n /**\n * Event filter condition has valid syntax but is not currently supported.\n */\n UnsupportedEventCondition = \"UnsupportedEventCondition\",\n\n /**\n * The provided experiment metric definition is invalid.\n * For example, defining a metric to calculate the average of a numeric property but\n * including a filter condition that compares it to a string value creates a type mismatch.\n */\n InvalidExperimentMetricDefinition = \"InvalidExperimentMetricDefinition\",\n}\n\n/**\n * The result of validating an experiment metric.\n */\nexport enum KnownValidationResult {\n /**\n * The experiment metric is valid.\n */\n Valid = \"Valid\",\n\n /**\n * The experiment metric is invalid.\n */\n Invalid = \"Invalid\",\n}\n"]}
|
package/dist/browser/index.d.ts
CHANGED
package/dist/browser/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,2BAA2B,MAAM,kCAAkC,CAAC;AAE3E,cAAc,kCAAkC,CAAC;AACjD,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AAErC,OAAO,EAAE,2BAA2B,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport OnlineExperimentationClient from \"./onlineExperimentationClient.js\";\n\nexport * from \"./onlineExperimentationClient.js\";\nexport * from \"./parameters.js\";\nexport * from \"./responses.js\";\nexport * from \"./clientDefinitions.js\";\nexport * from \"./isUnexpected.js\";\nexport * from \"./models.js\";\nexport * from \"./outputModels.js\";\nexport * from \"./paginateHelper.js\";\nexport * from \"./extensibleEnums.js\";\n\nexport { OnlineExperimentationClient };\n"]}
|
|
@@ -4,3 +4,4 @@ export declare function isUnexpected(response: CreateOrUpdateMetric200Response |
|
|
|
4
4
|
export declare function isUnexpected(response: DeleteMetric204Response | DeleteMetricDefaultResponse): response is DeleteMetricDefaultResponse;
|
|
5
5
|
export declare function isUnexpected(response: ValidateMetric200Response | ValidateMetricDefaultResponse): response is ValidateMetricDefaultResponse;
|
|
6
6
|
export declare function isUnexpected(response: ListMetrics200Response | ListMetricsDefaultResponse): response is ListMetricsDefaultResponse;
|
|
7
|
+
//# sourceMappingURL=isUnexpected.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAgBlC,MAAM,WAAW,GAA6B;IAC5C,8CAA8C,EAAE,CAAC,KAAK,CAAC;IACvD,gDAAgD,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAChE,iDAAiD,EAAE,CAAC,KAAK,CAAC;IAC1D,mCAAmC,EAAE,CAAC,KAAK,CAAC;IAC5C,yBAAyB,EAAE,CAAC,KAAK,CAAC;CACnC,CAAC;AAoBF,MAAM,UAAU,YAAY,CAC1B,QAW8B;IAO9B,MAAM,WAAW,GAAG,QAAQ,CAAC,OA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AAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetMetric200Response,\n GetMetricDefaultResponse,\n CreateOrUpdateMetric200Response,\n CreateOrUpdateMetric201Response,\n CreateOrUpdateMetricDefaultResponse,\n DeleteMetric204Response,\n DeleteMetricDefaultResponse,\n ValidateMetric200Response,\n ValidateMetricDefaultResponse,\n ListMetrics200Response,\n ListMetricsDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /experiment-metrics/{experimentMetricId}\": [\"200\"],\n \"PATCH /experiment-metrics/{experimentMetricId}\": [\"200\", \"201\"],\n \"DELETE /experiment-metrics/{experimentMetricId}\": [\"204\"],\n \"POST /experiment-metrics:validate\": [\"200\"],\n \"GET /experiment-metrics\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: GetMetric200Response | GetMetricDefaultResponse,\n): response is GetMetricDefaultResponse;\nexport function isUnexpected(\n response:\n | CreateOrUpdateMetric200Response\n | CreateOrUpdateMetric201Response\n | CreateOrUpdateMetricDefaultResponse,\n): response is CreateOrUpdateMetricDefaultResponse;\nexport function isUnexpected(\n response: DeleteMetric204Response | DeleteMetricDefaultResponse,\n): response is DeleteMetricDefaultResponse;\nexport function isUnexpected(\n response: ValidateMetric200Response | ValidateMetricDefaultResponse,\n): response is ValidateMetricDefaultResponse;\nexport function isUnexpected(\n response: ListMetrics200Response | ListMetricsDefaultResponse,\n): response is ListMetricsDefaultResponse;\nexport function isUnexpected(\n response:\n | GetMetric200Response\n | GetMetricDefaultResponse\n | CreateOrUpdateMetric200Response\n | CreateOrUpdateMetric201Response\n | CreateOrUpdateMetricDefaultResponse\n | DeleteMetric204Response\n | DeleteMetricDefaultResponse\n | ValidateMetric200Response\n | ValidateMetricDefaultResponse\n | ListMetrics200Response\n | ListMetricsDefaultResponse,\n): response is\n | GetMetricDefaultResponse\n | CreateOrUpdateMetricDefaultResponse\n | DeleteMetricDefaultResponse\n | ValidateMetricDefaultResponse\n | ListMetricsDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
package/dist/browser/logger.d.ts
CHANGED
package/dist/browser/logger.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,uBAAuB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"onlineexperimentation\");\n"]}
|
package/dist/browser/models.d.ts
CHANGED
package/dist/browser/models.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** Defines experiment metric metadata and computation details. */\nexport interface ExperimentMetric {\n /**\n * Determines whether it is included in experiment analysis.\n *\n * Possible values: \"Active\", \"Inactive\"\n */\n lifecycle: LifecycleStage;\n /** A user-friendly display name for the experiment metric shown in reports and dashboards. */\n displayName: string;\n /** A detailed description of the experiment metric. */\n description: string;\n /** Categories associated with the experiment metric. Used for organizing and filtering metrics. */\n categories: string[];\n /**\n * The desired direction for changes in the metric value.\n *\n * Possible values: \"Increase\", \"Decrease\", \"Neutral\"\n */\n desiredDirection: DesiredDirection;\n /** The metric definition specifying how the metric value is calculated from event data. */\n definition: ExperimentMetricDefinition;\n}\n\n/** The metric definition, which determines how the metric value is calculated from event data. */\nexport interface ExperimentMetricDefinitionParent {\n type: string;\n}\n\n/** The definition of an EventCount metric definition. Counts the occurrences of a specified event. */\nexport interface EventCountMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"EventCount\";\n /** Event to observe. */\n event: ObservedEvent;\n}\n\n/** An event observed by a metric. */\nexport interface ObservedEvent {\n /** The name of the event. */\n eventName: string;\n /** [Optional] A condition to filter events. */\n filter?: string;\n}\n\n/** The definition of a UserCount metric definition. Counts unique users who encounter a specified event. */\nexport interface UserCountMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"UserCount\";\n /** Event to observe. */\n event: ObservedEvent;\n}\n\n/** The definition of an EventRate metric definition. Calculates the percentage of events satisfying a specified condition. */\nexport interface EventRateMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"EventRate\";\n /** Event to observe as the rate denominator. */\n event: ObservedEvent;\n /** The event contributes to the rate numerator if it satisfies this condition. */\n rateCondition: string;\n}\n\n/** The definition of a UserRate metric definition. Calculates the percentage of users who encounter a start event and subsequently an end event. Users must encounter events in the specified order. */\nexport interface UserRateMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"UserRate\";\n /** The start event to observe as the rate denominator. */\n startEvent: ObservedEvent;\n /** The end event to observe, which is a condition for the rate numerator. */\n endEvent: ObservedEvent;\n}\n\n/** The definition of a Sum metric definition. Calculates the sum of a specified event property. Experiment analysis accounts for unequal traffic allocation. */\nexport interface SumMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"Sum\";\n /** The value to aggregate. */\n value: AggregatedValue;\n}\n\n/** An event property value aggregated by a metric. */\nexport interface AggregatedValue {\n /** The name of the event. */\n eventName: string;\n /** [Optional] A condition to filter events. */\n filter?: string;\n /** The key of the event property to aggregate. */\n eventProperty: string;\n}\n\n/** The definition of an Average metric definition. Calculates the average value of a specified event property. */\nexport interface AverageMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"Average\";\n /** The value to aggregate. */\n value: AggregatedValue;\n}\n\n/** The definition of a Percentile metric definition. Calculates a specified percentile of an event property. */\nexport interface PercentileMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"Percentile\";\n /** The value to aggregate, including the event name and property to measure. */\n value: AggregatedValue;\n /** The percentile to measure. */\n percentile: number;\n}\n\n/** The metric definition, which determines how the metric value is calculated from event data. */\nexport type ExperimentMetricDefinition =\n | ExperimentMetricDefinitionParent\n | EventCountMetricDefinition\n | UserCountMetricDefinition\n | EventRateMetricDefinition\n | UserRateMetricDefinition\n | SumMetricDefinition\n | AverageMetricDefinition\n | PercentileMetricDefinition;\n/** Alias for LifecycleStage */\nexport type LifecycleStage = string;\n/** Alias for DesiredDirection */\nexport type DesiredDirection = string;\n"]}
|
|
@@ -13,3 +13,4 @@ export interface OnlineExperimentationClientOptions extends ClientOptions {
|
|
|
13
13
|
* @param options - the parameter for all optional parameters
|
|
14
14
|
*/
|
|
15
15
|
export default function createClient(endpointParam: string, credentials: TokenCredential, { apiVersion, ...options }?: OnlineExperimentationClientOptions): OnlineExperimentationClient;
|
|
16
|
+
//# sourceMappingURL=onlineExperimentationClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onlineExperimentationClient.js","sourceRoot":"","sources":["../../src/onlineExperimentationClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUrC;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,aAAqB,EACrB,WAA4B,EAC5B,EAAE,UAAU,GAAG,oBAAoB,EAAE,GAAG,OAAO,KAAyC,EAAE;IAE1F,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,GAAG,aAAa,EAA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eAAe,UAAU,EAAE,CAAC;YAC9B,CAAC;YAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { OnlineExperimentationClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface OnlineExperimentationClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `OnlineExperimentationClient`\n * @param endpointParam - Endpoint URL for the Online Experimentation workspace.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential,\n { apiVersion = \"2025-05-31-preview\", ...options }: OnlineExperimentationClientOptions = {},\n): OnlineExperimentationClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`;\n const userAgentInfo = `azsdk-js-@azure-rest/onlineexperimentation/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n const clientOptions = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://exp.azure.net/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, clientOptions) as OnlineExperimentationClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n // eslint-disable-next-line no-param-reassign\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** Defines experiment metric metadata and computation details. */\nexport interface ExperimentMetricOutput {\n /** Identifier for this experiment metric. Must start with a lowercase letter and contain only lowercase letters, numbers, and underscores. */\n readonly id: string;\n /**\n * Determines whether it is included in experiment analysis.\n *\n * Possible values: \"Active\", \"Inactive\"\n */\n lifecycle: LifecycleStageOutput;\n /** A user-friendly display name for the experiment metric shown in reports and dashboards. */\n displayName: string;\n /** A detailed description of the experiment metric. */\n description: string;\n /** Categories associated with the experiment metric. Used for organizing and filtering metrics. */\n categories: string[];\n /**\n * The desired direction for changes in the metric value.\n *\n * Possible values: \"Increase\", \"Decrease\", \"Neutral\"\n */\n desiredDirection: DesiredDirectionOutput;\n /** The metric definition specifying how the metric value is calculated from event data. */\n definition: ExperimentMetricDefinitionOutput;\n /** ETag of the experiment metric. */\n readonly eTag: string;\n /** The timestamp (UTC) of the last modification to the experiment metric resource. */\n readonly lastModifiedAt: string;\n}\n\n/** The metric definition, which determines how the metric value is calculated from event data. */\nexport interface ExperimentMetricDefinitionOutputParent {\n type: string;\n}\n\n/** The definition of an EventCount metric definition. Counts the occurrences of a specified event. */\nexport interface EventCountMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"EventCount\";\n /** Event to observe. */\n event: ObservedEventOutput;\n}\n\n/** An event observed by a metric. */\nexport interface ObservedEventOutput {\n /** The name of the event. */\n eventName: string;\n /** [Optional] A condition to filter events. */\n filter?: string;\n}\n\n/** The definition of a UserCount metric definition. Counts unique users who encounter a specified event. */\nexport interface UserCountMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"UserCount\";\n /** Event to observe. */\n event: ObservedEventOutput;\n}\n\n/** The definition of an EventRate metric definition. Calculates the percentage of events satisfying a specified condition. */\nexport interface EventRateMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"EventRate\";\n /** Event to observe as the rate denominator. */\n event: ObservedEventOutput;\n /** The event contributes to the rate numerator if it satisfies this condition. */\n rateCondition: string;\n}\n\n/** The definition of a UserRate metric definition. Calculates the percentage of users who encounter a start event and subsequently an end event. Users must encounter events in the specified order. */\nexport interface UserRateMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"UserRate\";\n /** The start event to observe as the rate denominator. */\n startEvent: ObservedEventOutput;\n /** The end event to observe, which is a condition for the rate numerator. */\n endEvent: ObservedEventOutput;\n}\n\n/** The definition of a Sum metric definition. Calculates the sum of a specified event property. Experiment analysis accounts for unequal traffic allocation. */\nexport interface SumMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"Sum\";\n /** The value to aggregate. */\n value: AggregatedValueOutput;\n}\n\n/** An event property value aggregated by a metric. */\nexport interface AggregatedValueOutput {\n /** The name of the event. */\n eventName: string;\n /** [Optional] A condition to filter events. */\n filter?: string;\n /** The key of the event property to aggregate. */\n eventProperty: string;\n}\n\n/** The definition of an Average metric definition. Calculates the average value of a specified event property. */\nexport interface AverageMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"Average\";\n /** The value to aggregate. */\n value: AggregatedValueOutput;\n}\n\n/** The definition of a Percentile metric definition. Calculates a specified percentile of an event property. */\nexport interface PercentileMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"Percentile\";\n /** The value to aggregate, including the event name and property to measure. */\n value: AggregatedValueOutput;\n /** The percentile to measure. */\n percentile: number;\n}\n\n/** The result of validating an experiment metric. */\nexport interface ExperimentMetricValidationResultOutput {\n /** Indicates whether the experiment metric is valid. */\n isValid: boolean;\n /** Diagnostic details from the validation process. */\n readonly diagnostics: Array<DiagnosticDetailOutput>;\n}\n\n/** Diagnostic details for validation errors. */\nexport interface DiagnosticDetailOutput {\n /** A human-readable error message. */\n readonly message: string;\n /**\n * The diagnostic error code.\n *\n * Possible values: \"FailedSchemaValidation\", \"InvalidEventCondition\", \"UnsupportedEventCondition\", \"InvalidExperimentMetricDefinition\"\n */\n readonly code: DiagnosticCodeOutput;\n}\n\n/** Paged collection of ExperimentMetric items */\nexport interface PagedExperimentMetricOutput {\n /** The ExperimentMetric items on this page */\n value: Array<ExperimentMetricOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** The metric definition, which determines how the metric value is calculated from event data. */\nexport type ExperimentMetricDefinitionOutput =\n | ExperimentMetricDefinitionOutputParent\n | EventCountMetricDefinitionOutput\n | UserCountMetricDefinitionOutput\n | EventRateMetricDefinitionOutput\n | UserRateMetricDefinitionOutput\n | SumMetricDefinitionOutput\n | AverageMetricDefinitionOutput\n | PercentileMetricDefinitionOutput;\n/** Alias for LifecycleStageOutput */\nexport type LifecycleStageOutput = string;\n/** Alias for DesiredDirectionOutput */\nexport type DesiredDirectionOutput = string;\n/** Alias for DiagnosticCodeOutput */\nexport type DiagnosticCodeOutput = string;\n"]}
|
|
@@ -65,3 +65,4 @@ export type PaginateReturn<TResult> = TResult extends {
|
|
|
65
65
|
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
66
66
|
*/
|
|
67
67
|
export declare function paginate<TResponse extends PathUncheckedResponse>(client: Client, initialResponse: TResponse, options?: PagingOptions<TResponse>): PagedAsyncIterableIterator<PaginateReturn<TResponse>>;
|
|
68
|
+
//# sourceMappingURL=paginateHelper.d.ts.map
|
|
@@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AAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,kFAAkF,QAAQ,EAAE,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,IAAI,EAAE,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAS,kBAAkB,CAAC,QAA+B;IACzD,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAClG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,MAAM,eAAe,CACnB,gDAAgD,QAAQ,CAAC,MAAM,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Client, PathUncheckedResponse } from \"@azure-rest/core-client\";\nimport { createRestError } from \"@azure-rest/core-client\";\n\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\nfunction getPagedAsyncIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n TLink = string,\n>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {\n const iter = getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage:\n pagedResult?.byPage ??\n (((settings?: PageSettings) => {\n const { continuationToken } = settings ?? {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken as unknown as TLink | undefined,\n });\n }) as unknown as (settings?: TPageSettings) => AsyncIterableIterator<TPage>),\n };\n}\n\nasync function* getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n): AsyncIterableIterator<TElement> {\n const pages = getPageAsyncIterator(pagedResult);\n const firstVal = await pages.next();\n // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is\n if (!Array.isArray(firstVal.value)) {\n // can extract elements from this page\n const { toElements } = pagedResult;\n if (toElements) {\n yield* toElements(firstVal.value) as TElement[];\n for await (const page of pages) {\n yield* toElements(page) as TElement[];\n }\n } else {\n yield firstVal.value;\n // `pages` is of type `AsyncIterableIterator<TPage>` but TPage = TElement in this case\n yield* pages as unknown as AsyncIterableIterator<TElement>;\n }\n } else {\n yield* firstVal.value;\n for await (const page of pages) {\n // pages is of type `AsyncIterableIterator<TPage>` so `page` is of type `TPage`. In this branch,\n // it must be the case that `TPage = TElement[]`\n yield* page as unknown as TElement[];\n }\n }\n}\n\nasync function* getPageAsyncIterator<TPage, TLink, TPageSettings>(\n pagedResult: PagedResult<TPage, TPageSettings, TLink>,\n options: {\n pageLink?: TLink;\n } = {},\n): AsyncIterableIterator<TPage> {\n const { pageLink } = options;\n let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);\n if (!response) {\n return;\n }\n yield response.page;\n while (response.nextPageLink) {\n response = await pagedResult.getPage(response.nextPageLink);\n if (!response) {\n return;\n }\n yield response.page;\n }\n}\n\n/**\n * An interface that tracks the settings for paged iteration\n */\nexport interface PageSettings {\n /**\n * The token that keeps track of where to continue the iterator\n */\n continuationToken?: string;\n}\n\n/**\n * An interface that allows async iterable iteration both to completion and by page.\n */\nexport interface PagedAsyncIterableIterator<\n TElement,\n TPage = TElement[],\n TPageSettings = PageSettings,\n> {\n /**\n * The next method, part of the iteration protocol\n */\n next(): Promise<IteratorResult<TElement>>;\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n}\n\n/**\n * An interface that describes how to communicate with the service.\n */\ninterface PagedResult<TPage, TPageSettings = PageSettings, TLink = string> {\n /**\n * Link to the first page of results.\n */\n firstPageLink: TLink;\n /**\n * A method that returns a page of results.\n */\n getPage: (pageLink: TLink) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>;\n /**\n * a function to implement the `byPage` method on the paged async iterator.\n */\n byPage?: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;\n\n /**\n * A function to extract elements from a page.\n */\n toElements?: (page: TPage) => unknown[];\n}\n\n/**\n * Helper type to extract the type of an array\n */\nexport type GetArrayType<T> = T extends Array<infer TData> ? TData : never;\n\n/**\n * The type of a custom function that defines how to get a page and a link to the next one if any.\n */\nexport type GetPage<TPage> = (pageLink: string) => Promise<{\n page: TPage;\n nextPageLink?: string;\n}>;\n\n/**\n * Options for the paging helper\n */\nexport interface PagingOptions<TResponse> {\n /**\n * Custom function to extract pagination details for crating the PagedAsyncIterableIterator\n */\n customGetPage?: GetPage<PaginateReturn<TResponse>[]>;\n}\n\n/**\n * Helper type to infer the Type of the paged elements from the response type\n * This type is generated based on the swagger information for x-ms-pageable\n * specifically on the itemName property which indicates the property of the response\n * where the page items are found. The default value is `value`.\n * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter\n */\nexport type PaginateReturn<TResult> = TResult extends {\n body: { value?: infer TPage };\n}\n ? GetArrayType<TPage>\n : Array<unknown>;\n\n/**\n * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension\n * @param client - Client to use for sending the next page requests\n * @param initialResponse - Initial response containing the nextLink and current page of elements\n * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results\n * @returns - PagedAsyncIterableIterator to iterate the elements\n */\nexport function paginate<TResponse extends PathUncheckedResponse>(\n client: Client,\n initialResponse: TResponse,\n options: PagingOptions<TResponse> = {},\n): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {\n // Extract element type from initial response\n type TElement = PaginateReturn<TResponse>;\n let firstRun = true;\n const itemName = \"value\";\n const nextLinkName = \"nextLink\";\n const { customGetPage } = options;\n const pagedResult: PagedResult<TElement[]> = {\n firstPageLink: \"\",\n getPage:\n typeof customGetPage === \"function\"\n ? customGetPage\n : async (pageLink: string) => {\n const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get();\n firstRun = false;\n checkPagingRequest(result);\n const nextLink = getNextLink(result.body, nextLinkName);\n const values = getElements<TElement>(result.body, itemName);\n return {\n page: values,\n nextPageLink: nextLink,\n };\n },\n };\n\n return getPagedAsyncIterator(pagedResult);\n}\n\n/**\n * Gets for the value of nextLink in the body\n */\nfunction getNextLink(body: unknown, nextLinkName?: string): string | undefined {\n if (!nextLinkName) {\n return undefined;\n }\n\n const nextLink = (body as Record<string, unknown>)[nextLinkName];\n\n if (typeof nextLink !== \"string\" && typeof nextLink !== \"undefined\") {\n throw new Error(`Body Property ${nextLinkName} should be a string or undefined`);\n }\n\n return nextLink;\n}\n\n/**\n * Gets the elements of the current request in the body.\n */\nfunction getElements<T = unknown>(body: unknown, itemName: string): T[] {\n const value = (body as Record<string, unknown>)[itemName] as T[];\n\n // value has to be an array according to the x-ms-pageable extension.\n // The fact that this must be an array is used above to calculate the\n // type of elements in the page in PaginateReturn\n if (!Array.isArray(value)) {\n throw new Error(\n `Couldn't paginate response\\n Body doesn't contain an array property with name: ${itemName}`,\n );\n }\n\n return value ?? [];\n}\n\n/**\n * Checks if a request failed\n */\nfunction checkPagingRequest(response: PathUncheckedResponse): void {\n const Http2xxStatusCodes = [\"200\", \"201\", \"202\", \"203\", \"204\", \"205\", \"206\", \"207\", \"208\", \"226\"];\n if (!Http2xxStatusCodes.includes(response.status)) {\n throw createRestError(\n `Pagination failed with unexpected statusCode ${response.status}`,\n response,\n );\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../src/parameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeadersInput } from \"@azure/core-rest-pipeline\";\nimport type { RequestParameters } from \"@azure-rest/core-client\";\nimport type { ExperimentMetric } from \"./models.js\";\n\nexport interface GetMetricHeaders {\n /** The request should only proceed if an entity matches this string. */\n \"If-Match\"?: string;\n /** The request should only proceed if no entity matches this string. */\n \"If-None-Match\"?: string;\n /** The request should only proceed if the entity was not modified after this time. */\n \"If-Unmodified-Since\"?: string;\n /** The request should only proceed if the entity was modified after this time. */\n \"If-Modified-Since\"?: string;\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface GetMetricHeaderParam {\n headers?: RawHttpHeadersInput & GetMetricHeaders;\n}\n\nexport type GetMetricParameters = GetMetricHeaderParam & RequestParameters;\n\nexport interface CreateOrUpdateMetricHeaders {\n /** The request should only proceed if an entity matches this string. */\n \"If-Match\"?: string;\n /** The request should only proceed if no entity matches this string. */\n \"If-None-Match\"?: string;\n /** The request should only proceed if the entity was not modified after this time. */\n \"If-Unmodified-Since\"?: string;\n /** The request should only proceed if the entity was modified after this time. */\n \"If-Modified-Since\"?: string;\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\n/** The resource instance. */\nexport type ExperimentMetricResourceMergeAndPatch = Partial<ExperimentMetric>;\n\nexport interface CreateOrUpdateMetricBodyParam {\n /** The resource instance. */\n body: ExperimentMetricResourceMergeAndPatch;\n}\n\nexport interface CreateOrUpdateMetricHeaderParam {\n headers?: RawHttpHeadersInput & CreateOrUpdateMetricHeaders;\n}\n\nexport interface CreateOrUpdateMetricMediaTypesParam {\n /** This request has a JSON Merge Patch body. */\n contentType: \"application/merge-patch+json\";\n}\n\nexport type CreateOrUpdateMetricParameters = CreateOrUpdateMetricHeaderParam &\n CreateOrUpdateMetricMediaTypesParam &\n CreateOrUpdateMetricBodyParam &\n RequestParameters;\n\nexport interface ValidateMetricHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface ValidateMetricBodyParam {\n /** Experiment metric input to validate */\n body: ExperimentMetric;\n}\n\nexport interface ValidateMetricHeaderParam {\n headers?: RawHttpHeadersInput & ValidateMetricHeaders;\n}\n\nexport type ValidateMetricParameters = ValidateMetricHeaderParam &\n ValidateMetricBodyParam &\n RequestParameters;\n\nexport interface DeleteMetricHeaders {\n /** The request should only proceed if an entity matches this string. */\n \"If-Match\"?: string;\n /** The request should only proceed if no entity matches this string. */\n \"If-None-Match\"?: string;\n /** The request should only proceed if the entity was not modified after this time. */\n \"If-Unmodified-Since\"?: string;\n /** The request should only proceed if the entity was modified after this time. */\n \"If-Modified-Since\"?: string;\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface DeleteMetricHeaderParam {\n headers?: RawHttpHeadersInput & DeleteMetricHeaders;\n}\n\nexport type DeleteMetricParameters = DeleteMetricHeaderParam & RequestParameters;\n\nexport interface ListMetricsHeaders {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\nexport interface ListMetricsQueryParamProperties {\n /** The number of result items to return. */\n top?: number;\n /** The number of result items to skip. */\n skip?: number;\n /** The maximum number of result items per page. */\n maxpagesize?: number;\n}\n\nexport interface ListMetricsQueryParam {\n queryParameters?: ListMetricsQueryParamProperties;\n}\n\nexport interface ListMetricsHeaderParam {\n headers?: RawHttpHeadersInput & ListMetricsHeaders;\n}\n\nexport type ListMetricsParameters = ListMetricsQueryParam &\n ListMetricsHeaderParam &\n RequestParameters;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../src/responses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawHttpHeaders } from \"@azure/core-rest-pipeline\";\nimport type { HttpResponse, ErrorResponse } from \"@azure-rest/core-client\";\nimport type {\n ExperimentMetricOutput,\n ExperimentMetricValidationResultOutput,\n PagedExperimentMetricOutput,\n} from \"./outputModels.js\";\n\nexport interface GetMetric200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface GetMetric200Response extends HttpResponse {\n status: \"200\";\n body: ExperimentMetricOutput;\n headers: RawHttpHeaders & GetMetric200Headers;\n}\n\nexport interface GetMetricDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface GetMetricDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & GetMetricDefaultHeaders;\n}\n\nexport interface CreateOrUpdateMetric200Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface CreateOrUpdateMetric200Response extends HttpResponse {\n status: \"200\";\n body: ExperimentMetricOutput;\n headers: RawHttpHeaders & CreateOrUpdateMetric200Headers;\n}\n\nexport interface CreateOrUpdateMetric201Headers {\n /** The entity tag for the response. */\n etag?: string;\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\n/** The request has succeeded and a new resource has been created as a result. */\nexport interface CreateOrUpdateMetric201Response extends HttpResponse {\n status: \"201\";\n body: ExperimentMetricOutput;\n headers: RawHttpHeaders & CreateOrUpdateMetric201Headers;\n}\n\nexport interface CreateOrUpdateMetricDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface CreateOrUpdateMetricDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & CreateOrUpdateMetricDefaultHeaders;\n}\n\nexport interface ValidateMetric200Headers {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface ValidateMetric200Response extends HttpResponse {\n status: \"200\";\n body: ExperimentMetricValidationResultOutput;\n headers: RawHttpHeaders & ValidateMetric200Headers;\n}\n\nexport interface ValidateMetricDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ValidateMetricDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ValidateMetricDefaultHeaders;\n}\n\nexport interface DeleteMetric204Headers {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\n/** There is no content to send for this request, but the headers may be useful. */\nexport interface DeleteMetric204Response extends HttpResponse {\n status: \"204\";\n headers: RawHttpHeaders & DeleteMetric204Headers;\n}\n\nexport interface DeleteMetricDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface DeleteMetricDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & DeleteMetricDefaultHeaders;\n}\n\nexport interface ListMetrics200Headers {\n /** An opaque, globally-unique, client-generated string identifier for the request. */\n \"x-ms-client-request-id\"?: string;\n}\n\n/** The request has succeeded. */\nexport interface ListMetrics200Response extends HttpResponse {\n status: \"200\";\n body: PagedExperimentMetricOutput;\n headers: RawHttpHeaders & ListMetrics200Headers;\n}\n\nexport interface ListMetricsDefaultHeaders {\n /** String error code indicating what went wrong. */\n \"x-ms-error-code\"?: string;\n}\n\nexport interface ListMetricsDefaultResponse extends HttpResponse {\n status: string;\n body: ErrorResponse;\n headers: RawHttpHeaders & ListMetricsDefaultHeaders;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientDefinitions.js","sourceRoot":"","sources":["../../src/clientDefinitions.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetMetricParameters,\n CreateOrUpdateMetricParameters,\n DeleteMetricParameters,\n ValidateMetricParameters,\n ListMetricsParameters,\n} from \"./parameters.js\";\nimport type {\n GetMetric200Response,\n GetMetricDefaultResponse,\n CreateOrUpdateMetric200Response,\n CreateOrUpdateMetric201Response,\n CreateOrUpdateMetricDefaultResponse,\n DeleteMetric204Response,\n DeleteMetricDefaultResponse,\n ValidateMetric200Response,\n ValidateMetricDefaultResponse,\n ListMetrics200Response,\n ListMetricsDefaultResponse,\n} from \"./responses.js\";\nimport type { Client, StreamableMethod } from \"@azure-rest/core-client\";\n\nexport interface GetMetric {\n /** Fetches an experiment metric by ID. */\n get(\n options?: GetMetricParameters,\n ): StreamableMethod<GetMetric200Response | GetMetricDefaultResponse>;\n /** Creates or updates an experiment metric. */\n patch(\n options: CreateOrUpdateMetricParameters,\n ): StreamableMethod<\n | CreateOrUpdateMetric200Response\n | CreateOrUpdateMetric201Response\n | CreateOrUpdateMetricDefaultResponse\n >;\n /** Deletes an experiment metric. */\n delete(\n options?: DeleteMetricParameters,\n ): StreamableMethod<DeleteMetric204Response | DeleteMetricDefaultResponse>;\n}\n\nexport interface ValidateMetric {\n /** Validates an experiment metric definition. */\n post(\n options: ValidateMetricParameters,\n ): StreamableMethod<ValidateMetric200Response | ValidateMetricDefaultResponse>;\n}\n\nexport interface ListMetrics {\n /** Lists experiment metrics. */\n get(\n options?: ListMetricsParameters,\n ): StreamableMethod<ListMetrics200Response | ListMetricsDefaultResponse>;\n}\n\nexport interface Routes {\n /** Resource for '/experiment-metrics/\\{experimentMetricId\\}' has methods for the following verbs: get, patch, delete */\n (path: \"/experiment-metrics/{experimentMetricId}\", experimentMetricId: string): GetMetric;\n /** Resource for '/experiment-metrics:validate' has methods for the following verbs: post */\n (path: \"/experiment-metrics:validate\"): ValidateMetric;\n /** Resource for '/experiment-metrics' has methods for the following verbs: get */\n (path: \"/experiment-metrics\"): ListMetrics;\n}\n\nexport type OnlineExperimentationClient = Client & {\n path: Routes;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensibleEnums.js","sourceRoot":"","sources":["../../src/extensibleEnums.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;GAEG;AACH,IAAY,qBAeX;AAfD,WAAY,qBAAqB;IAC/B;;OAEG;IACH,8CAAqB,CAAA;IAErB;;OAEG;IACH,8CAAqB,CAAA;IAErB;;OAEG;IACH,4CAAmB,CAAA;AACrB,CAAC,EAfW,qBAAqB,qCAArB,qBAAqB,QAehC;AAED;;GAEG;AACH,IAAY,yBAmCX;AAnCD,WAAY,yBAAyB;IACnC;;OAEG;IACH,sDAAyB,CAAA;IAEzB;;OAEG;IACH,oDAAuB,CAAA;IAEvB;;OAEG;IACH,oDAAuB,CAAA;IAEvB;;OAEG;IACH,kDAAqB,CAAA;IAErB;;OAEG;IACH,wCAAW,CAAA;IAEX;;OAEG;IACH,gDAAmB,CAAA;IAEnB;;OAEG;IACH,sDAAyB,CAAA;AAC3B,CAAC,EAnCW,yBAAyB,yCAAzB,yBAAyB,QAmCpC;AAED;;GAEG;AACH,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC7B;;OAEG;IACH,wCAAiB,CAAA;IAEjB;;OAEG;IACH,4CAAqB,CAAA;AACvB,CAAC,EAVW,mBAAmB,mCAAnB,mBAAmB,QAU9B;AAED;;GAEG;AACH,IAAY,mBAsBX;AAtBD,WAAY,mBAAmB;IAC7B;;OAEG;IACH,wEAAiD,CAAA;IAEjD;;OAEG;IACH,sEAA+C,CAAA;IAE/C;;OAEG;IACH,8EAAuD,CAAA;IAEvD;;;;OAIG;IACH,8FAAuE,CAAA;AACzE,CAAC,EAtBW,mBAAmB,mCAAnB,mBAAmB,QAsB9B;AAED;;GAEG;AACH,IAAY,qBAUX;AAVD,WAAY,qBAAqB;IAC/B;;OAEG;IACH,wCAAe,CAAA;IAEf;;OAEG;IACH,4CAAmB,CAAA;AACrB,CAAC,EAVW,qBAAqB,qCAArB,qBAAqB,QAUhC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Desired direction for an experiment metric value.\n */\nexport enum KnownDesiredDirection {\n /**\n * An increase to the metric value is desired. E.g., Success rate, Total revenue.\n */\n Increase = \"Increase\",\n\n /**\n * A decrease to the metric value is desired. E.g., Error rate, Latency.\n */\n Decrease = \"Decrease\",\n\n /**\n * Neither an increase nor a decrease to the metric value is desired, or the desired direction depends on other factors. E.g., Number of video play attempts, Number of user feedbacks\n */\n Neutral = \"Neutral\",\n}\n\n/**\n * How the metric definition calculates metric values from event data.\n */\nexport enum KnownExperimentMetricType {\n /**\n * Counts the occurrences of an event. Experiment analysis accounts for unequal traffic allocation.\n */\n EventCount = \"EventCount\",\n\n /**\n * Counts the number of unique users who encounter an event. Experiment analysis accounts for unequal traffic allocation.\n */\n UserCount = \"UserCount\",\n\n /**\n * Calculates the percentage of events that satisfy a specified condition.\n */\n EventRate = \"EventRate\",\n\n /**\n * Calculates the percentage of users who encounter a start event and subsequently encounter an end event. Users must encounter the start event before the end event to be counted.\n */\n UserRate = \"UserRate\",\n\n /**\n * Calculates the sum of a specified event property. Experiment analysis accounts for unequal traffic allocation.\n */\n Sum = \"Sum\",\n\n /**\n * Calculates the average value of a specified event property.\n */\n Average = \"Average\",\n\n /**\n * Calculates a specified percentile of an event property.\n */\n Percentile = \"Percentile\",\n}\n\n/**\n * Lifecycle stages of an experiment metric, determining whether the metric is included in experiment analysis.\n */\nexport enum KnownLifecycleStage {\n /**\n * The metric is included in experiment analysis.\n */\n Active = \"Active\",\n\n /**\n * The metric is excluded from experiment analysis but remains available for future use.\n */\n Inactive = \"Inactive\",\n}\n\n/**\n * The diagnostic error codes.\n */\nexport enum KnownDiagnosticCode {\n /**\n * The metric definition does not conform to the JSON schema.\n */\n FailedSchemaValidation = \"FailedSchemaValidation\",\n\n /**\n * The event filter condition is invalid.\n */\n InvalidEventCondition = \"InvalidEventCondition\",\n\n /**\n * Event filter condition has valid syntax but is not currently supported.\n */\n UnsupportedEventCondition = \"UnsupportedEventCondition\",\n\n /**\n * The provided experiment metric definition is invalid.\n * For example, defining a metric to calculate the average of a numeric property but\n * including a filter condition that compares it to a string value creates a type mismatch.\n */\n InvalidExperimentMetricDefinition = \"InvalidExperimentMetricDefinition\",\n}\n\n/**\n * The result of validating an experiment metric.\n */\nexport enum KnownValidationResult {\n /**\n * The experiment metric is valid.\n */\n Valid = \"Valid\",\n\n /**\n * The experiment metric is invalid.\n */\n Invalid = \"Invalid\",\n}\n"]}
|
package/dist/commonjs/index.d.ts
CHANGED
package/dist/commonjs/index.js
CHANGED
|
@@ -1,33 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT License.
|
|
4
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
-
if (k2 === undefined) k2 = k;
|
|
6
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(o, k2, desc);
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
-
};
|
|
18
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
-
};
|
|
21
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
5
|
exports.OnlineExperimentationClient = void 0;
|
|
23
|
-
const
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const onlineExperimentationClient_js_1 = tslib_1.__importDefault(require("./onlineExperimentationClient.js"));
|
|
24
8
|
exports.OnlineExperimentationClient = onlineExperimentationClient_js_1.default;
|
|
25
|
-
__exportStar(require("./onlineExperimentationClient.js"), exports);
|
|
26
|
-
__exportStar(require("./parameters.js"), exports);
|
|
27
|
-
__exportStar(require("./responses.js"), exports);
|
|
28
|
-
__exportStar(require("./clientDefinitions.js"), exports);
|
|
29
|
-
__exportStar(require("./isUnexpected.js"), exports);
|
|
30
|
-
__exportStar(require("./models.js"), exports);
|
|
31
|
-
__exportStar(require("./outputModels.js"), exports);
|
|
32
|
-
__exportStar(require("./paginateHelper.js"), exports);
|
|
33
|
-
__exportStar(require("./extensibleEnums.js"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./onlineExperimentationClient.js"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./parameters.js"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./responses.js"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./clientDefinitions.js"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./isUnexpected.js"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./models.js"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./outputModels.js"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./paginateHelper.js"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./extensibleEnums.js"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,8GAA2E;AAYlE,sCAZF,wCAA2B,CAYE;AAVpC,2EAAiD;AACjD,0DAAgC;AAChC,yDAA+B;AAC/B,iEAAuC;AACvC,4DAAkC;AAClC,sDAA4B;AAC5B,4DAAkC;AAClC,8DAAoC;AACpC,+DAAqC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport OnlineExperimentationClient from \"./onlineExperimentationClient.js\";\n\nexport * from \"./onlineExperimentationClient.js\";\nexport * from \"./parameters.js\";\nexport * from \"./responses.js\";\nexport * from \"./clientDefinitions.js\";\nexport * from \"./isUnexpected.js\";\nexport * from \"./models.js\";\nexport * from \"./outputModels.js\";\nexport * from \"./paginateHelper.js\";\nexport * from \"./extensibleEnums.js\";\n\nexport { OnlineExperimentationClient };\n"]}
|
|
@@ -4,3 +4,4 @@ export declare function isUnexpected(response: CreateOrUpdateMetric200Response |
|
|
|
4
4
|
export declare function isUnexpected(response: DeleteMetric204Response | DeleteMetricDefaultResponse): response is DeleteMetricDefaultResponse;
|
|
5
5
|
export declare function isUnexpected(response: ValidateMetric200Response | ValidateMetricDefaultResponse): response is ValidateMetricDefaultResponse;
|
|
6
6
|
export declare function isUnexpected(response: ListMetrics200Response | ListMetricsDefaultResponse): response is ListMetricsDefaultResponse;
|
|
7
|
+
//# sourceMappingURL=isUnexpected.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA0ClC,oCA2BC;AArDD,MAAM,WAAW,GAA6B;IAC5C,8CAA8C,EAAE,CAAC,KAAK,CAAC;IACvD,gDAAgD,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAChE,iDAAiD,EAAE,CAAC,KAAK,CAAC;IAC1D,mCAAmC,EAAE,CAAC,KAAK,CAAC;IAC5C,yBAAyB,EAAE,CAAC,KAAK,CAAC;CACnC,CAAC;AAoBF,SAAgB,YAAY,CA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ED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n GetMetric200Response,\n GetMetricDefaultResponse,\n CreateOrUpdateMetric200Response,\n CreateOrUpdateMetric201Response,\n CreateOrUpdateMetricDefaultResponse,\n DeleteMetric204Response,\n DeleteMetricDefaultResponse,\n ValidateMetric200Response,\n ValidateMetricDefaultResponse,\n ListMetrics200Response,\n ListMetricsDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /experiment-metrics/{experimentMetricId}\": [\"200\"],\n \"PATCH /experiment-metrics/{experimentMetricId}\": [\"200\", \"201\"],\n \"DELETE /experiment-metrics/{experimentMetricId}\": [\"204\"],\n \"POST /experiment-metrics:validate\": [\"200\"],\n \"GET /experiment-metrics\": [\"200\"],\n};\n\nexport function isUnexpected(\n response: GetMetric200Response | GetMetricDefaultResponse,\n): response is GetMetricDefaultResponse;\nexport function isUnexpected(\n response:\n | CreateOrUpdateMetric200Response\n | CreateOrUpdateMetric201Response\n | CreateOrUpdateMetricDefaultResponse,\n): response is CreateOrUpdateMetricDefaultResponse;\nexport function isUnexpected(\n response: DeleteMetric204Response | DeleteMetricDefaultResponse,\n): response is DeleteMetricDefaultResponse;\nexport function isUnexpected(\n response: ValidateMetric200Response | ValidateMetricDefaultResponse,\n): response is ValidateMetricDefaultResponse;\nexport function isUnexpected(\n response: ListMetrics200Response | ListMetricsDefaultResponse,\n): response is ListMetricsDefaultResponse;\nexport function isUnexpected(\n response:\n | GetMetric200Response\n | GetMetricDefaultResponse\n | CreateOrUpdateMetric200Response\n | CreateOrUpdateMetric201Response\n | CreateOrUpdateMetricDefaultResponse\n | DeleteMetric204Response\n | DeleteMetricDefaultResponse\n | ValidateMetric200Response\n | ValidateMetricDefaultResponse\n | ListMetrics200Response\n | ListMetricsDefaultResponse,\n): response is\n | GetMetricDefaultResponse\n | CreateOrUpdateMetricDefaultResponse\n | DeleteMetricDefaultResponse\n | ValidateMetricDefaultResponse\n | ListMetricsDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
package/dist/commonjs/logger.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,0CAAmD;AACtC,QAAA,MAAM,GAAG,IAAA,2BAAkB,EAAC,uBAAuB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"onlineexperimentation\");\n"]}
|
package/dist/commonjs/models.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** Defines experiment metric metadata and computation details. */\nexport interface ExperimentMetric {\n /**\n * Determines whether it is included in experiment analysis.\n *\n * Possible values: \"Active\", \"Inactive\"\n */\n lifecycle: LifecycleStage;\n /** A user-friendly display name for the experiment metric shown in reports and dashboards. */\n displayName: string;\n /** A detailed description of the experiment metric. */\n description: string;\n /** Categories associated with the experiment metric. Used for organizing and filtering metrics. */\n categories: string[];\n /**\n * The desired direction for changes in the metric value.\n *\n * Possible values: \"Increase\", \"Decrease\", \"Neutral\"\n */\n desiredDirection: DesiredDirection;\n /** The metric definition specifying how the metric value is calculated from event data. */\n definition: ExperimentMetricDefinition;\n}\n\n/** The metric definition, which determines how the metric value is calculated from event data. */\nexport interface ExperimentMetricDefinitionParent {\n type: string;\n}\n\n/** The definition of an EventCount metric definition. Counts the occurrences of a specified event. */\nexport interface EventCountMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"EventCount\";\n /** Event to observe. */\n event: ObservedEvent;\n}\n\n/** An event observed by a metric. */\nexport interface ObservedEvent {\n /** The name of the event. */\n eventName: string;\n /** [Optional] A condition to filter events. */\n filter?: string;\n}\n\n/** The definition of a UserCount metric definition. Counts unique users who encounter a specified event. */\nexport interface UserCountMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"UserCount\";\n /** Event to observe. */\n event: ObservedEvent;\n}\n\n/** The definition of an EventRate metric definition. Calculates the percentage of events satisfying a specified condition. */\nexport interface EventRateMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"EventRate\";\n /** Event to observe as the rate denominator. */\n event: ObservedEvent;\n /** The event contributes to the rate numerator if it satisfies this condition. */\n rateCondition: string;\n}\n\n/** The definition of a UserRate metric definition. Calculates the percentage of users who encounter a start event and subsequently an end event. Users must encounter events in the specified order. */\nexport interface UserRateMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"UserRate\";\n /** The start event to observe as the rate denominator. */\n startEvent: ObservedEvent;\n /** The end event to observe, which is a condition for the rate numerator. */\n endEvent: ObservedEvent;\n}\n\n/** The definition of a Sum metric definition. Calculates the sum of a specified event property. Experiment analysis accounts for unequal traffic allocation. */\nexport interface SumMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"Sum\";\n /** The value to aggregate. */\n value: AggregatedValue;\n}\n\n/** An event property value aggregated by a metric. */\nexport interface AggregatedValue {\n /** The name of the event. */\n eventName: string;\n /** [Optional] A condition to filter events. */\n filter?: string;\n /** The key of the event property to aggregate. */\n eventProperty: string;\n}\n\n/** The definition of an Average metric definition. Calculates the average value of a specified event property. */\nexport interface AverageMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"Average\";\n /** The value to aggregate. */\n value: AggregatedValue;\n}\n\n/** The definition of a Percentile metric definition. Calculates a specified percentile of an event property. */\nexport interface PercentileMetricDefinition extends ExperimentMetricDefinitionParent {\n /** The type of metric. */\n type: \"Percentile\";\n /** The value to aggregate, including the event name and property to measure. */\n value: AggregatedValue;\n /** The percentile to measure. */\n percentile: number;\n}\n\n/** The metric definition, which determines how the metric value is calculated from event data. */\nexport type ExperimentMetricDefinition =\n | ExperimentMetricDefinitionParent\n | EventCountMetricDefinition\n | UserCountMetricDefinition\n | EventRateMetricDefinition\n | UserRateMetricDefinition\n | SumMetricDefinition\n | AverageMetricDefinition\n | PercentileMetricDefinition;\n/** Alias for LifecycleStage */\nexport type LifecycleStage = string;\n/** Alias for DesiredDirection */\nexport type DesiredDirection = string;\n"]}
|
|
@@ -13,3 +13,4 @@ export interface OnlineExperimentationClientOptions extends ClientOptions {
|
|
|
13
13
|
* @param options - the parameter for all optional parameters
|
|
14
14
|
*/
|
|
15
15
|
export default function createClient(endpointParam: string, credentials: TokenCredential, { apiVersion, ...options }?: OnlineExperimentationClientOptions): OnlineExperimentationClient;
|
|
16
|
+
//# sourceMappingURL=onlineExperimentationClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onlineExperimentationClient.js","sourceRoot":"","sources":["../../src/onlineExperimentationClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAoBlC,+BA4CC;AA7DD,yDAAoD;AACpD,2CAAqC;AAUrC;;;;;GAKG;AACH,SAAwB,YAAY,CAClC,aAAqB,EACrB,WAA4B,EAC5B,EAAE,UAAU,GAAG,oBAAoB,EAAE,GAAG,OAAO,KAAyC,EAAE;IAE1F,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,GAAG,aAAa,EAAE,CAAC;IAC9E,MAAM,aAAa,GAAG,yDAAyD,CAAC;IAChF,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAA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,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ClientOptions } from \"@azure-rest/core-client\";\nimport { getClient } from \"@azure-rest/core-client\";\nimport { logger } from \"./logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport type { OnlineExperimentationClient } from \"./clientDefinitions.js\";\n\n/** The optional parameters for the client */\nexport interface OnlineExperimentationClientOptions extends ClientOptions {\n /** The api version option of the client */\n apiVersion?: string;\n}\n\n/**\n * Initialize a new instance of `OnlineExperimentationClient`\n * @param endpointParam - Endpoint URL for the Online Experimentation workspace.\n * @param credentials - uniquely identify client credential\n * @param options - the parameter for all optional parameters\n */\nexport default function createClient(\n endpointParam: string,\n credentials: TokenCredential,\n { apiVersion = \"2025-05-31-preview\", ...options }: OnlineExperimentationClientOptions = {},\n): OnlineExperimentationClient {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? `${endpointParam}`;\n const userAgentInfo = `azsdk-js-@azure-rest/onlineexperimentation/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n const clientOptions = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n loggingOptions: {\n logger: options.loggingOptions?.logger ?? logger.info,\n },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://exp.azure.net/.default\"],\n },\n };\n const client = getClient(endpointUrl, credentials, clientOptions) as OnlineExperimentationClient;\n\n client.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n client.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n if (!url.searchParams.get(\"api-version\") && apiVersion) {\n // eslint-disable-next-line no-param-reassign\n req.url = `${req.url}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${apiVersion}`;\n }\n\n return next(req);\n },\n });\n\n return client;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outputModels.js","sourceRoot":"","sources":["../../src/outputModels.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** Defines experiment metric metadata and computation details. */\nexport interface ExperimentMetricOutput {\n /** Identifier for this experiment metric. Must start with a lowercase letter and contain only lowercase letters, numbers, and underscores. */\n readonly id: string;\n /**\n * Determines whether it is included in experiment analysis.\n *\n * Possible values: \"Active\", \"Inactive\"\n */\n lifecycle: LifecycleStageOutput;\n /** A user-friendly display name for the experiment metric shown in reports and dashboards. */\n displayName: string;\n /** A detailed description of the experiment metric. */\n description: string;\n /** Categories associated with the experiment metric. Used for organizing and filtering metrics. */\n categories: string[];\n /**\n * The desired direction for changes in the metric value.\n *\n * Possible values: \"Increase\", \"Decrease\", \"Neutral\"\n */\n desiredDirection: DesiredDirectionOutput;\n /** The metric definition specifying how the metric value is calculated from event data. */\n definition: ExperimentMetricDefinitionOutput;\n /** ETag of the experiment metric. */\n readonly eTag: string;\n /** The timestamp (UTC) of the last modification to the experiment metric resource. */\n readonly lastModifiedAt: string;\n}\n\n/** The metric definition, which determines how the metric value is calculated from event data. */\nexport interface ExperimentMetricDefinitionOutputParent {\n type: string;\n}\n\n/** The definition of an EventCount metric definition. Counts the occurrences of a specified event. */\nexport interface EventCountMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"EventCount\";\n /** Event to observe. */\n event: ObservedEventOutput;\n}\n\n/** An event observed by a metric. */\nexport interface ObservedEventOutput {\n /** The name of the event. */\n eventName: string;\n /** [Optional] A condition to filter events. */\n filter?: string;\n}\n\n/** The definition of a UserCount metric definition. Counts unique users who encounter a specified event. */\nexport interface UserCountMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"UserCount\";\n /** Event to observe. */\n event: ObservedEventOutput;\n}\n\n/** The definition of an EventRate metric definition. Calculates the percentage of events satisfying a specified condition. */\nexport interface EventRateMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"EventRate\";\n /** Event to observe as the rate denominator. */\n event: ObservedEventOutput;\n /** The event contributes to the rate numerator if it satisfies this condition. */\n rateCondition: string;\n}\n\n/** The definition of a UserRate metric definition. Calculates the percentage of users who encounter a start event and subsequently an end event. Users must encounter events in the specified order. */\nexport interface UserRateMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"UserRate\";\n /** The start event to observe as the rate denominator. */\n startEvent: ObservedEventOutput;\n /** The end event to observe, which is a condition for the rate numerator. */\n endEvent: ObservedEventOutput;\n}\n\n/** The definition of a Sum metric definition. Calculates the sum of a specified event property. Experiment analysis accounts for unequal traffic allocation. */\nexport interface SumMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"Sum\";\n /** The value to aggregate. */\n value: AggregatedValueOutput;\n}\n\n/** An event property value aggregated by a metric. */\nexport interface AggregatedValueOutput {\n /** The name of the event. */\n eventName: string;\n /** [Optional] A condition to filter events. */\n filter?: string;\n /** The key of the event property to aggregate. */\n eventProperty: string;\n}\n\n/** The definition of an Average metric definition. Calculates the average value of a specified event property. */\nexport interface AverageMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"Average\";\n /** The value to aggregate. */\n value: AggregatedValueOutput;\n}\n\n/** The definition of a Percentile metric definition. Calculates a specified percentile of an event property. */\nexport interface PercentileMetricDefinitionOutput extends ExperimentMetricDefinitionOutputParent {\n /** The type of metric. */\n type: \"Percentile\";\n /** The value to aggregate, including the event name and property to measure. */\n value: AggregatedValueOutput;\n /** The percentile to measure. */\n percentile: number;\n}\n\n/** The result of validating an experiment metric. */\nexport interface ExperimentMetricValidationResultOutput {\n /** Indicates whether the experiment metric is valid. */\n isValid: boolean;\n /** Diagnostic details from the validation process. */\n readonly diagnostics: Array<DiagnosticDetailOutput>;\n}\n\n/** Diagnostic details for validation errors. */\nexport interface DiagnosticDetailOutput {\n /** A human-readable error message. */\n readonly message: string;\n /**\n * The diagnostic error code.\n *\n * Possible values: \"FailedSchemaValidation\", \"InvalidEventCondition\", \"UnsupportedEventCondition\", \"InvalidExperimentMetricDefinition\"\n */\n readonly code: DiagnosticCodeOutput;\n}\n\n/** Paged collection of ExperimentMetric items */\nexport interface PagedExperimentMetricOutput {\n /** The ExperimentMetric items on this page */\n value: Array<ExperimentMetricOutput>;\n /** The link to the next page of items */\n nextLink?: string;\n}\n\n/** The metric definition, which determines how the metric value is calculated from event data. */\nexport type ExperimentMetricDefinitionOutput =\n | ExperimentMetricDefinitionOutputParent\n | EventCountMetricDefinitionOutput\n | UserCountMetricDefinitionOutput\n | EventRateMetricDefinitionOutput\n | UserRateMetricDefinitionOutput\n | SumMetricDefinitionOutput\n | AverageMetricDefinitionOutput\n | PercentileMetricDefinitionOutput;\n/** Alias for LifecycleStageOutput */\nexport type LifecycleStageOutput = string;\n/** Alias for DesiredDirectionOutput */\nexport type DesiredDirectionOutput = string;\n/** Alias for DiagnosticCodeOutput */\nexport type DiagnosticCodeOutput = string;\n"]}
|
|
@@ -65,3 +65,4 @@ export type PaginateReturn<TResult> = TResult extends {
|
|
|
65
65
|
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
66
66
|
*/
|
|
67
67
|
export declare function paginate<TResponse extends PathUncheckedResponse>(client: Client, initialResponse: TResponse, options?: PagingOptions<TResponse>): PagedAsyncIterableIterator<PaginateReturn<TResponse>>;
|
|
68
|
+
//# sourceMappingURL=paginateHelper.d.ts.map
|