@azure-rest/arm-servicefabric 1.0.0-beta.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.
@@ -0,0 +1,48 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { LroEngine, } from "@azure/core-lro";
4
+ /**
5
+ * Helper function that builds a Poller object to help polling a long running operation.
6
+ * @param client - Client to use for sending the request to get additional pages.
7
+ * @param initialResponse - The initial response.
8
+ * @param options - Options to set a resume state or custom polling interval.
9
+ * @returns - A poller object to poll for operation state updates and eventually get the final response.
10
+ */
11
+ export function getLongRunningPoller(client, initialResponse, options = {}) {
12
+ const poller = {
13
+ requestMethod: initialResponse.request.method,
14
+ requestPath: initialResponse.request.url,
15
+ sendInitialRequest: async () => {
16
+ // In the case of Rest Clients we are building the LRO poller object from a response that's the reason
17
+ // we are not triggering the initial request here, just extracting the information from the
18
+ // response we were provided.
19
+ return getLroResponse(initialResponse);
20
+ },
21
+ sendPollRequest: async (path) => {
22
+ // This is the callback that is going to be called to poll the service
23
+ // to get the latest status. We use the client provided and the polling path
24
+ // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location
25
+ // depending on the lro pattern that the service implements. If non is provided we default to the initial path.
26
+ const response = await client.pathUnchecked(path !== null && path !== void 0 ? path : initialResponse.request.url).get();
27
+ const lroResponse = getLroResponse(response);
28
+ lroResponse.rawResponse.headers["x-ms-original-url"] = initialResponse.request.url;
29
+ return lroResponse;
30
+ },
31
+ };
32
+ return new LroEngine(poller, options);
33
+ }
34
+ /**
35
+ * Converts a Rest Client response to a response that the LRO engine knows about
36
+ * @param response - a rest client http response
37
+ * @returns - An LRO response that the LRO engine can work with
38
+ */
39
+ function getLroResponse(response) {
40
+ if (Number.isNaN(response.status)) {
41
+ throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);
42
+ }
43
+ return {
44
+ flatResponse: response,
45
+ rawResponse: Object.assign(Object.assign({}, response), { statusCode: Number.parseInt(response.status), body: response.body }),
46
+ };
47
+ }
48
+ //# sourceMappingURL=pollingHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pollingHelper.js","sourceRoot":"","sources":["../../src/pollingHelper.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAEL,SAAS,GAKV,MAAM,iBAAiB,CAAC;AAEzB;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAc,EACd,eAAwB,EACxB,UAAkE,EAAE;IAEpE,MAAM,MAAM,GAAkC;QAC5C,aAAa,EAAE,eAAe,CAAC,OAAO,CAAC,MAAM;QAC7C,WAAW,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG;QACxC,kBAAkB,EAAE,KAAK,IAAI,EAAE;YAC7B,sGAAsG;YACtG,2FAA2F;YAC3F,6BAA6B;YAC7B,OAAO,cAAc,CAAC,eAAe,CAAC,CAAC;QACzC,CAAC;QACD,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YAC9B,sEAAsE;YACtE,4EAA4E;YAC5E,0JAA0J;YAC1J,+GAA+G;YAC/G,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YACvF,MAAM,WAAW,GAAG,cAAc,CAAC,QAAmB,CAAC,CAAC;YACxD,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC;YACnF,OAAO,WAAW,CAAC;QACrB,CAAC;KACF,CAAC;IAEF,OAAO,IAAI,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAA+B,QAAiB;IACrE,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;QACjC,MAAM,IAAI,SAAS,CAAC,uDAAuD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;KAC/F;IAED,OAAO;QACL,YAAY,EAAE,QAAQ;QACtB,WAAW,kCACN,QAAQ,KACX,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAC5C,IAAI,EAAE,QAAQ,CAAC,IAAI,GACpB;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Client, HttpResponse } from \"@azure-rest/core-client\";\nimport {\n LongRunningOperation,\n LroEngine,\n LroEngineOptions,\n LroResponse,\n PollOperationState,\n PollerLike,\n} from \"@azure/core-lro\";\n\n/**\n * Helper function that builds a Poller object to help polling a long running operation.\n * @param client - Client to use for sending the request to get additional pages.\n * @param initialResponse - The initial response.\n * @param options - Options to set a resume state or custom polling interval.\n * @returns - A poller object to poll for operation state updates and eventually get the final response.\n */\nexport function getLongRunningPoller<TResult extends HttpResponse>(\n client: Client,\n initialResponse: TResult,\n options: LroEngineOptions<TResult, PollOperationState<TResult>> = {}\n): PollerLike<PollOperationState<TResult>, TResult> {\n const poller: LongRunningOperation<TResult> = {\n requestMethod: initialResponse.request.method,\n requestPath: initialResponse.request.url,\n sendInitialRequest: async () => {\n // In the case of Rest Clients we are building the LRO poller object from a response that's the reason\n // we are not triggering the initial request here, just extracting the information from the\n // response we were provided.\n return getLroResponse(initialResponse);\n },\n sendPollRequest: async (path) => {\n // This is the callback that is going to be called to poll the service\n // to get the latest status. We use the client provided and the polling path\n // which is an opaque URL provided by caller, the service sends this in one of the following headers: operation-location, azure-asyncoperation or location\n // depending on the lro pattern that the service implements. If non is provided we default to the initial path.\n const response = await client.pathUnchecked(path ?? initialResponse.request.url).get();\n const lroResponse = getLroResponse(response as TResult);\n lroResponse.rawResponse.headers[\"x-ms-original-url\"] = initialResponse.request.url;\n return lroResponse;\n },\n };\n\n return new LroEngine(poller, options);\n}\n\n/**\n * Converts a Rest Client response to a response that the LRO engine knows about\n * @param response - a rest client http response\n * @returns - An LRO response that the LRO engine can work with\n */\nfunction getLroResponse<TResult extends HttpResponse>(response: TResult): LroResponse<TResult> {\n if (Number.isNaN(response.status)) {\n throw new TypeError(`Status code of the response is not a number. Value: ${response.status}`);\n }\n\n return {\n flatResponse: response,\n rawResponse: {\n ...response,\n statusCode: Number.parseInt(response.status),\n body: response.body,\n },\n };\n}\n"]}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ export {};
4
+ //# sourceMappingURL=responses.js.map
@@ -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 { HttpResponse } from \"@azure-rest/core-client\";\nimport {\n ApplicationResourceListOutput,\n ApplicationResourceOutput,\n ApplicationTypeResourceListOutput,\n ApplicationTypeResourceOutput,\n ApplicationTypeVersionResourceListOutput,\n ApplicationTypeVersionResourceOutput,\n ClusterCodeVersionsListResultOutput,\n ClusterListResultOutput,\n ClusterOutput,\n ErrorModelOutput,\n OperationListResultOutput,\n ServiceResourceListOutput,\n ServiceResourceOutput,\n UpgradableVersionPathResultOutput,\n} from \"./outputModels\";\n\n/** Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. */\nexport interface ClustersGet200Response extends HttpResponse {\n status: \"200\";\n body: ClusterOutput;\n}\n\n/** Get a Service Fabric cluster resource created or in the process of being created in the specified resource group. */\nexport interface ClustersGetdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Create or update a Service Fabric cluster resource with the specified name. */\nexport interface ClustersCreateOrUpdate200Response extends HttpResponse {\n status: \"200\";\n body: ClusterOutput;\n}\n\n/** Create or update a Service Fabric cluster resource with the specified name. */\nexport interface ClustersCreateOrUpdate202Response extends HttpResponse {\n status: \"202\";\n body: ClusterOutput;\n}\n\n/** Create or update a Service Fabric cluster resource with the specified name. */\nexport interface ClustersCreateOrUpdatedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Update the configuration of a Service Fabric cluster resource with the specified name. */\nexport interface ClustersUpdate200Response extends HttpResponse {\n status: \"200\";\n body: ClusterOutput;\n}\n\n/** Update the configuration of a Service Fabric cluster resource with the specified name. */\nexport interface ClustersUpdate202Response extends HttpResponse {\n status: \"202\";\n body: ClusterOutput;\n}\n\n/** Update the configuration of a Service Fabric cluster resource with the specified name. */\nexport interface ClustersUpdatedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Delete a Service Fabric cluster resource with the specified name. */\nexport interface ClustersDelete200Response extends HttpResponse {\n status: \"200\";\n body: Record<string, unknown>;\n}\n\n/** Delete a Service Fabric cluster resource with the specified name. */\nexport interface ClustersDelete204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\n/** Delete a Service Fabric cluster resource with the specified name. */\nexport interface ClustersDeletedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Gets all Service Fabric cluster resources created or in the process of being created in the resource group. */\nexport interface ClustersListByResourceGroup200Response extends HttpResponse {\n status: \"200\";\n body: ClusterListResultOutput;\n}\n\n/** Gets all Service Fabric cluster resources created or in the process of being created in the resource group. */\nexport interface ClustersListByResourceGroupdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Gets all Service Fabric cluster resources created or in the process of being created in the subscription. */\nexport interface ClustersList200Response extends HttpResponse {\n status: \"200\";\n body: ClusterListResultOutput;\n}\n\n/** Gets all Service Fabric cluster resources created or in the process of being created in the subscription. */\nexport interface ClustersListdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** If a target is not provided, it will get the minimum and maximum versions available from the current cluster version. If a target is given, it will provide the required path to get from the current cluster version to the target version. */\nexport interface ClustersListUpgradableVersions200Response extends HttpResponse {\n status: \"200\";\n body: UpgradableVersionPathResultOutput;\n}\n\n/** If a target is not provided, it will get the minimum and maximum versions available from the current cluster version. If a target is given, it will provide the required path to get from the current cluster version to the target version. */\nexport interface ClustersListUpgradableVersionsdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Gets information about an available Service Fabric cluster code version. */\nexport interface ClusterVersionsGet200Response extends HttpResponse {\n status: \"200\";\n body: ClusterCodeVersionsListResultOutput;\n}\n\n/** Gets information about an available Service Fabric cluster code version. */\nexport interface ClusterVersionsGetdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Gets information about an available Service Fabric cluster code version by environment. */\nexport interface ClusterVersionsGetByEnvironment200Response extends HttpResponse {\n status: \"200\";\n body: ClusterCodeVersionsListResultOutput;\n}\n\n/** Gets information about an available Service Fabric cluster code version by environment. */\nexport interface ClusterVersionsGetByEnvironmentdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Gets all available code versions for Service Fabric cluster resources by location. */\nexport interface ClusterVersionsList200Response extends HttpResponse {\n status: \"200\";\n body: ClusterCodeVersionsListResultOutput;\n}\n\n/** Gets all available code versions for Service Fabric cluster resources by location. */\nexport interface ClusterVersionsListdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Gets all available code versions for Service Fabric cluster resources by environment. */\nexport interface ClusterVersionsListByEnvironment200Response extends HttpResponse {\n status: \"200\";\n body: ClusterCodeVersionsListResultOutput;\n}\n\n/** Gets all available code versions for Service Fabric cluster resources by environment. */\nexport interface ClusterVersionsListByEnvironmentdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Get the list of available Service Fabric resource provider API operations. */\nexport interface OperationsList200Response extends HttpResponse {\n status: \"200\";\n body: OperationListResultOutput;\n}\n\n/** Get the list of available Service Fabric resource provider API operations. */\nexport interface OperationsListdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric cluster resource. */\nexport interface ApplicationTypesGet200Response extends HttpResponse {\n status: \"200\";\n body: ApplicationTypeResourceOutput;\n}\n\n/** Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric cluster resource. */\nexport interface ApplicationTypesGetdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Create or update a Service Fabric application type name resource with the specified name. */\nexport interface ApplicationTypesCreateOrUpdate200Response extends HttpResponse {\n status: \"200\";\n body: ApplicationTypeResourceOutput;\n}\n\n/** Create or update a Service Fabric application type name resource with the specified name. */\nexport interface ApplicationTypesCreateOrUpdatedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Delete a Service Fabric application type name resource with the specified name. */\nexport interface ApplicationTypesDelete202Response extends HttpResponse {\n status: \"202\";\n body: Record<string, unknown>;\n}\n\n/** Delete a Service Fabric application type name resource with the specified name. */\nexport interface ApplicationTypesDelete204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\n/** Delete a Service Fabric application type name resource with the specified name. */\nexport interface ApplicationTypesDeletedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Gets all application type name resources created or in the process of being created in the Service Fabric cluster resource. */\nexport interface ApplicationTypesList200Response extends HttpResponse {\n status: \"200\";\n body: ApplicationTypeResourceListOutput;\n}\n\n/** Gets all application type name resources created or in the process of being created in the Service Fabric cluster resource. */\nexport interface ApplicationTypesListdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Get a Service Fabric application type version resource created or in the process of being created in the Service Fabric application type name resource. */\nexport interface ApplicationTypeVersionsGet200Response extends HttpResponse {\n status: \"200\";\n body: ApplicationTypeVersionResourceOutput;\n}\n\n/** Get a Service Fabric application type version resource created or in the process of being created in the Service Fabric application type name resource. */\nexport interface ApplicationTypeVersionsGetdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Create or update a Service Fabric application type version resource with the specified name. */\nexport interface ApplicationTypeVersionsCreateOrUpdate202Response extends HttpResponse {\n status: \"202\";\n body: ApplicationTypeVersionResourceOutput;\n}\n\n/** Create or update a Service Fabric application type version resource with the specified name. */\nexport interface ApplicationTypeVersionsCreateOrUpdatedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Delete a Service Fabric application type version resource with the specified name. */\nexport interface ApplicationTypeVersionsDelete202Response extends HttpResponse {\n status: \"202\";\n body: Record<string, unknown>;\n}\n\n/** Delete a Service Fabric application type version resource with the specified name. */\nexport interface ApplicationTypeVersionsDelete204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\n/** Delete a Service Fabric application type version resource with the specified name. */\nexport interface ApplicationTypeVersionsDeletedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Gets all application type version resources created or in the process of being created in the Service Fabric application type name resource. */\nexport interface ApplicationTypeVersionsList200Response extends HttpResponse {\n status: \"200\";\n body: ApplicationTypeVersionResourceListOutput;\n}\n\n/** Gets all application type version resources created or in the process of being created in the Service Fabric application type name resource. */\nexport interface ApplicationTypeVersionsListdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Get a Service Fabric application resource created or in the process of being created in the Service Fabric cluster resource. */\nexport interface ApplicationsGet200Response extends HttpResponse {\n status: \"200\";\n body: ApplicationResourceOutput;\n}\n\n/** Get a Service Fabric application resource created or in the process of being created in the Service Fabric cluster resource. */\nexport interface ApplicationsGetdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Create or update a Service Fabric application resource with the specified name. */\nexport interface ApplicationsCreateOrUpdate202Response extends HttpResponse {\n status: \"202\";\n body: ApplicationResourceOutput;\n}\n\n/** Create or update a Service Fabric application resource with the specified name. */\nexport interface ApplicationsCreateOrUpdatedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Update a Service Fabric application resource with the specified name. */\nexport interface ApplicationsUpdate202Response extends HttpResponse {\n status: \"202\";\n body: ApplicationResourceOutput;\n}\n\n/** Update a Service Fabric application resource with the specified name. */\nexport interface ApplicationsUpdatedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Delete a Service Fabric application resource with the specified name. */\nexport interface ApplicationsDelete202Response extends HttpResponse {\n status: \"202\";\n body: Record<string, unknown>;\n}\n\n/** Delete a Service Fabric application resource with the specified name. */\nexport interface ApplicationsDelete204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\n/** Delete a Service Fabric application resource with the specified name. */\nexport interface ApplicationsDeletedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Gets all application resources created or in the process of being created in the Service Fabric cluster resource. */\nexport interface ApplicationsList200Response extends HttpResponse {\n status: \"200\";\n body: ApplicationResourceListOutput;\n}\n\n/** Gets all application resources created or in the process of being created in the Service Fabric cluster resource. */\nexport interface ApplicationsListdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Get a Service Fabric service resource created or in the process of being created in the Service Fabric application resource. */\nexport interface ServicesGet200Response extends HttpResponse {\n status: \"200\";\n body: ServiceResourceOutput;\n}\n\n/** Get a Service Fabric service resource created or in the process of being created in the Service Fabric application resource. */\nexport interface ServicesGetdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Create or update a Service Fabric service resource with the specified name. */\nexport interface ServicesCreateOrUpdate202Response extends HttpResponse {\n status: \"202\";\n body: ServiceResourceOutput;\n}\n\n/** Create or update a Service Fabric service resource with the specified name. */\nexport interface ServicesCreateOrUpdatedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Update a Service Fabric service resource with the specified name. */\nexport interface ServicesUpdate202Response extends HttpResponse {\n status: \"202\";\n body: ServiceResourceOutput;\n}\n\n/** Update a Service Fabric service resource with the specified name. */\nexport interface ServicesUpdatedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Delete a Service Fabric service resource with the specified name. */\nexport interface ServicesDelete202Response extends HttpResponse {\n status: \"202\";\n body: Record<string, unknown>;\n}\n\n/** Delete a Service Fabric service resource with the specified name. */\nexport interface ServicesDelete204Response extends HttpResponse {\n status: \"204\";\n body: Record<string, unknown>;\n}\n\n/** Delete a Service Fabric service resource with the specified name. */\nexport interface ServicesDeletedefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n\n/** Gets all service resources created or in the process of being created in the Service Fabric application resource. */\nexport interface ServicesList200Response extends HttpResponse {\n status: \"200\";\n body: ServiceResourceListOutput;\n}\n\n/** Gets all service resources created or in the process of being created in the Service Fabric application resource. */\nexport interface ServicesListdefaultResponse extends HttpResponse {\n status: string;\n body: ErrorModelOutput;\n}\n"]}
@@ -0,0 +1,27 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import { getClient } from "@azure-rest/core-client";
4
+ import { customizedApiVersionPolicy } from "./customizedApiVersionPolicy";
5
+ export default function createClient(credentials, options = {}) {
6
+ var _a, _b;
7
+ const baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : "https://management.azure.com";
8
+ options.apiVersion = (_b = options.apiVersion) !== null && _b !== void 0 ? _b : "2021-06-01";
9
+ options = Object.assign(Object.assign({}, options), { credentials: {
10
+ scopes: ["https://management.azure.com/.default"],
11
+ } });
12
+ const userAgentInfo = `azsdk-js-arm-servicefabric-rest/1.0.0-beta.1`;
13
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
14
+ ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
15
+ : `${userAgentInfo}`;
16
+ options = Object.assign(Object.assign({}, options), { userAgentOptions: {
17
+ userAgentPrefix,
18
+ } });
19
+ const client = getClient(baseUrl, credentials, options);
20
+ // Considering ApiVersionPolicy in core has bugs so we replace with our customized one
21
+ client.pipeline.removePolicy({
22
+ name: "ApiVersionPolicy",
23
+ });
24
+ client.pipeline.addPolicy(customizedApiVersionPolicy(options));
25
+ return client;
26
+ }
27
+ //# sourceMappingURL=serviceFabricClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceFabricClient.js","sourceRoot":"","sources":["../../src/serviceFabricClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAiB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,WAA4B,EAC5B,UAAyB,EAAE;;IAE3B,MAAM,OAAO,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,8BAA8B,CAAC;IAClE,OAAO,CAAC,UAAU,GAAG,MAAA,OAAO,CAAC,UAAU,mCAAI,YAAY,CAAC;IACxD,OAAO,mCACF,OAAO,KACV,WAAW,EAAE;YACX,MAAM,EAAE,CAAC,uCAAuC,CAAC;SAClD,GACF,CAAC;IAEF,MAAM,aAAa,GAAG,8CAA8C,CAAC;IACrE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;QAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,aAAa,EAAE;QAChE,CAAC,CAAC,GAAG,aAAa,EAAE,CAAC;IACzB,OAAO,mCACF,OAAO,KACV,gBAAgB,EAAE;YAChB,eAAe;SAChB,GACF,CAAC;IAEF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAwB,CAAC;IAC/E,sFAAsF;IACtF,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC3B,IAAI,EAAE,kBAAkB;KACzB,CAAC,CAAC;IACH,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,CAAC;IAE/D,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\nimport { ServiceFabricClient } from \"./clientDefinitions\";\nimport { customizedApiVersionPolicy } from \"./customizedApiVersionPolicy\";\n\nexport default function createClient(\n credentials: TokenCredential,\n options: ClientOptions = {}\n): ServiceFabricClient {\n const baseUrl = options.baseUrl ?? \"https://management.azure.com\";\n options.apiVersion = options.apiVersion ?? \"2021-06-01\";\n options = {\n ...options,\n credentials: {\n scopes: [\"https://management.azure.com/.default\"],\n },\n };\n\n const userAgentInfo = `azsdk-js-arm-servicefabric-rest/1.0.0-beta.1`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`\n : `${userAgentInfo}`;\n options = {\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n };\n\n const client = getClient(baseUrl, credentials, options) as ServiceFabricClient;\n // Considering ApiVersionPolicy in core has bugs so we replace with our customized one\n client.pipeline.removePolicy({\n name: \"ApiVersionPolicy\",\n });\n client.pipeline.addPolicy(customizedApiVersionPolicy(options));\n\n return client;\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,127 @@
1
+ {
2
+ "name": "@azure-rest/arm-servicefabric",
3
+ "sdk-type": "client",
4
+ "author": "Microsoft Corporation",
5
+ "version": "1.0.0-beta.1",
6
+ "description": "",
7
+ "keywords": [
8
+ "node",
9
+ "azure",
10
+ "cloud",
11
+ "typescript",
12
+ "browser",
13
+ "isomorphic"
14
+ ],
15
+ "license": "MIT",
16
+ "main": "dist/index.js",
17
+ "module": "./dist-esm/src/index.js",
18
+ "types": "./types/arm-servicefabric.d.ts",
19
+ "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/servicefabric/arm-servicefabric-rest/README.md",
20
+ "repository": "github:Azure/azure-sdk-for-js",
21
+ "bugs": {
22
+ "url": "https://github.com/Azure/azure-sdk-for-js/issues"
23
+ },
24
+ "files": [
25
+ "dist/",
26
+ "dist-esm/src/",
27
+ "types/arm-servicefabric.d.ts",
28
+ "README.md",
29
+ "LICENSE",
30
+ "review/*"
31
+ ],
32
+ "//metadata": {
33
+ "constantPaths": [
34
+ {
35
+ "path": "swagger/README.md",
36
+ "prefix": "package-version"
37
+ }
38
+ ]
39
+ },
40
+ "engines": {
41
+ "node": ">=12.0.0"
42
+ },
43
+ "scripts": {
44
+ "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
45
+ "build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
46
+ "build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1",
47
+ "build:samples": "echo skipped.",
48
+ "build:test": "tsc -p . && dev-tool run bundle",
49
+ "build:debug": "tsc -p . && dev-tool run bundle && api-extractor run --local",
50
+ "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
51
+ "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
52
+ "execute:samples": "dev-tool samples run samples-dev",
53
+ "extract-api": "rimraf review && mkdirp ./review && api-extractor run --local",
54
+ "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
55
+ "generate:client": "autorest --typescript swagger/README.md && npm run format",
56
+ "integration-test:browser": "dev-tool run test:browser",
57
+ "integration-test:node": "dev-tool run test:node-js-input -- --timeout 5000000 'dist-esm/test/**/*.spec.js'",
58
+ "integration-test": "npm run integration-test:node && npm run integration-test:browser",
59
+ "lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
60
+ "lint": "eslint package.json api-extractor.json src test --ext .ts",
61
+ "pack": "npm pack 2>&1",
62
+ "test:browser": "npm run clean && npm run build:test && npm run unit-test:browser",
63
+ "test:node": "npm run clean && npm run build:test && npm run unit-test:node",
64
+ "test": "npm run clean && npm run build:test && npm run unit-test",
65
+ "unit-test": "npm run unit-test:node && npm run unit-test:browser",
66
+ "unit-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 --exclude 'test/**/browser/*.spec.ts' 'test/**/*.spec.ts'",
67
+ "unit-test:browser": "dev-tool run test:browser",
68
+ "build": "npm run clean && tsc -p . && dev-tool run bundle && mkdirp ./review && api-extractor run --local"
69
+ },
70
+ "sideEffects": false,
71
+ "autoPublish": false,
72
+ "dependencies": {
73
+ "@azure/core-auth": "^1.3.0",
74
+ "@azure-rest/core-client": "1.0.0-beta.10",
75
+ "@azure/core-rest-pipeline": "^1.8.0",
76
+ "@azure/logger": "^1.0.0",
77
+ "tslib": "^2.2.0",
78
+ "@azure/core-paging": "^1.2.0",
79
+ "@azure/core-lro": "^2.2.0"
80
+ },
81
+ "devDependencies": {
82
+ "@microsoft/api-extractor": "7.18.11",
83
+ "autorest": "latest",
84
+ "@types/node": "^12.0.0",
85
+ "dotenv": "^8.2.0",
86
+ "eslint": "^7.15.0",
87
+ "mkdirp": "^1.0.4",
88
+ "prettier": "2.2.1",
89
+ "rimraf": "^3.0.0",
90
+ "source-map-support": "^0.5.9",
91
+ "typescript": "~4.2.0",
92
+ "@azure/dev-tool": "^1.0.0",
93
+ "@azure/eslint-plugin-azure-sdk": "^3.0.0",
94
+ "@azure-tools/test-credential": "^1.0.0",
95
+ "@azure/identity": "^2.0.1",
96
+ "@azure-tools/test-recorder": "^2.0.0",
97
+ "mocha": "^7.1.1",
98
+ "mocha-junit-reporter": "^1.18.0",
99
+ "cross-env": "^7.0.2",
100
+ "@types/chai": "^4.2.8",
101
+ "chai": "^4.2.0",
102
+ "karma-chrome-launcher": "^3.0.0",
103
+ "karma-coverage": "^2.0.0",
104
+ "karma-edge-launcher": "^0.4.2",
105
+ "karma-env-preprocessor": "^0.1.1",
106
+ "karma-firefox-launcher": "^1.1.0",
107
+ "karma-ie-launcher": "^1.0.0",
108
+ "karma-junit-reporter": "^2.0.1",
109
+ "karma-mocha-reporter": "^2.2.5",
110
+ "karma-mocha": "^2.0.1",
111
+ "karma-source-map-support": "~1.4.0",
112
+ "karma-sourcemap-loader": "^0.3.8",
113
+ "karma": "^6.2.0",
114
+ "nyc": "^14.0.0"
115
+ },
116
+ "browser": {
117
+ "./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js"
118
+ },
119
+ "//sampleConfiguration": {
120
+ "productName": "",
121
+ "productSlugs": [
122
+ "azure"
123
+ ],
124
+ "disableDocsMs": true,
125
+ "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure-rest/arm-servicefabric?view=azure-node-preview"
126
+ }
127
+ }