@missioncontrolio/client 0.0.3

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.
Files changed (42) hide show
  1. package/.env.local.example +9 -0
  2. package/README.md +226 -0
  3. package/package.json +25 -0
  4. package/src/client/autoCancelOrderHandler.ts +135 -0
  5. package/src/client/clientBuilder.ts +139 -0
  6. package/src/client/generated/client.ts +130 -0
  7. package/src/client/generated/kiota-lock.json +34 -0
  8. package/src/client/generated/models/index.ts +1723 -0
  9. package/src/client/generated/order/cancelOrder/index.ts +53 -0
  10. package/src/client/generated/order/claimReservation/index.ts +34 -0
  11. package/src/client/generated/order/claimReservation/item/index.ts +53 -0
  12. package/src/client/generated/order/createOrder/index.ts +53 -0
  13. package/src/client/generated/order/index.ts +112 -0
  14. package/src/client/generated/order/reportOrder/index.ts +53 -0
  15. package/src/client/generated/partner/index.ts +55 -0
  16. package/src/client/generated/priceList/index.ts +55 -0
  17. package/src/client/generated/product/hasStock/index.ts +53 -0
  18. package/src/client/generated/product/index.ts +119 -0
  19. package/src/client/generated/publisher/index.ts +55 -0
  20. package/src/client/generated/region/index.ts +63 -0
  21. package/src/client/generated/reservation/index.ts +71 -0
  22. package/src/client/generated/reservation/item/cancel/index.ts +48 -0
  23. package/src/client/generated/reservation/item/index.ts +62 -0
  24. package/src/client/missionControlEnvironment.ts +32 -0
  25. package/src/client/missionControlHandlers.ts +61 -0
  26. package/src/client/missionControlHeaders.ts +10 -0
  27. package/src/client/nonIdempotentPaths.ts +9 -0
  28. package/src/client/partnerIdHandler.ts +33 -0
  29. package/tests/autoCancelOrderHandler.test.ts +263 -0
  30. package/tests/clientBuilder.test.ts +154 -0
  31. package/tests/integration/fixture.ts +50 -0
  32. package/tests/integration/partner.test.ts +32 -0
  33. package/tests/integration/priceList.test.ts +28 -0
  34. package/tests/integration/product.test.ts +30 -0
  35. package/tests/integration/publisher.test.ts +30 -0
  36. package/tests/integration/region.test.ts +36 -0
  37. package/tests/integration/setup.ts +22 -0
  38. package/tests/missionControlEnvironment.test.ts +66 -0
  39. package/tests/missionControlHeaders.test.ts +20 -0
  40. package/tsconfig.json +18 -0
  41. package/vitest.config.ts +8 -0
  42. package/vitest.integration.config.ts +9 -0
@@ -0,0 +1,53 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ // Generated by Microsoft Kiota
4
+ // @ts-ignore
5
+ import { createOrderFromDiscriminatorValue, createProblemDetailsFromDiscriminatorValue, serializeCancelOrderRequest, serializeOrder, type CancelOrderRequest, type Order, type ProblemDetails } from '../../models/index.js';
6
+ // @ts-ignore
7
+ import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
8
+
9
+ /**
10
+ * Builds and executes requests for operations under /Order/cancelOrder
11
+ */
12
+ export interface CancelOrderRequestBuilder extends BaseRequestBuilder<CancelOrderRequestBuilder> {
13
+ /**
14
+ * Typically only works very shortly after placing the order.Depending on the type of product, key supplier, time elapsed, etc. cancellation might not be possible, in which case the API will return an error. Use this API if there is an issue with the order right after placing it, for example:There was a client timeout.Your system failed to process the response from the Create Order endpoint.Mission Control returned a 5xx error.The order is identified by the original request ID that was provided when creating the order.
15
+ * @param body Request to cancel an order.
16
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
17
+ * @returns {Promise<Order>}
18
+ * @throws {ProblemDetails} error when the service returns a 400 status code
19
+ * @throws {ProblemDetails} error when the service returns a 500 status code
20
+ */
21
+ post(body: CancelOrderRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<Order | undefined>;
22
+ /**
23
+ * Typically only works very shortly after placing the order.Depending on the type of product, key supplier, time elapsed, etc. cancellation might not be possible, in which case the API will return an error. Use this API if there is an issue with the order right after placing it, for example:There was a client timeout.Your system failed to process the response from the Create Order endpoint.Mission Control returned a 5xx error.The order is identified by the original request ID that was provided when creating the order.
24
+ * @param body Request to cancel an order.
25
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
26
+ * @returns {RequestInformation}
27
+ */
28
+ toPostRequestInformation(body: CancelOrderRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : RequestInformation;
29
+ }
30
+ /**
31
+ * Uri template for the request builder.
32
+ */
33
+ export const CancelOrderRequestBuilderUriTemplate = "{+baseurl}/Order/cancelOrder";
34
+ /**
35
+ * Metadata for all the requests in the request builder.
36
+ */
37
+ export const CancelOrderRequestBuilderRequestsMetadata: RequestsMetadata = {
38
+ post: {
39
+ uriTemplate: CancelOrderRequestBuilderUriTemplate,
40
+ responseBodyContentType: "application/json, text/plain;q=0.9",
41
+ errorMappings: {
42
+ 400: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
43
+ 500: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
44
+ },
45
+ adapterMethodName: "send",
46
+ responseBodyFactory: createOrderFromDiscriminatorValue,
47
+ requestBodyContentType: "application/json",
48
+ requestBodySerializer: serializeCancelOrderRequest,
49
+ requestInformationContentSetMethod: "setContentFromParsable",
50
+ },
51
+ };
52
+ /* tslint:enable */
53
+ /* eslint-enable */
@@ -0,0 +1,34 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ // Generated by Microsoft Kiota
4
+ // @ts-ignore
5
+ import { type WithReservationItemRequestBuilder, WithReservationItemRequestBuilderRequestsMetadata } from './item/index.js';
6
+ // @ts-ignore
7
+ import { type BaseRequestBuilder, type Guid, type KeysToExcludeForNavigationMetadata, type NavigationMetadata } from '@microsoft/kiota-abstractions';
8
+
9
+ /**
10
+ * Builds and executes requests for operations under /Order/claimReservation
11
+ */
12
+ export interface ClaimReservationRequestBuilder extends BaseRequestBuilder<ClaimReservationRequestBuilder> {
13
+ /**
14
+ * Gets an item from the missioncontrol.client.Order.claimReservation.item collection
15
+ * @param reservationId Unique identifier of the item
16
+ * @returns {WithReservationItemRequestBuilder}
17
+ */
18
+ byReservationId(reservationId: Guid) : WithReservationItemRequestBuilder;
19
+ }
20
+ /**
21
+ * Uri template for the request builder.
22
+ */
23
+ export const ClaimReservationRequestBuilderUriTemplate = "{+baseurl}/Order/claimReservation";
24
+ /**
25
+ * Metadata for all the navigation properties in the request builder.
26
+ */
27
+ export const ClaimReservationRequestBuilderNavigationMetadata: Record<Exclude<keyof ClaimReservationRequestBuilder, KeysToExcludeForNavigationMetadata>, NavigationMetadata> = {
28
+ byReservationId: {
29
+ requestsMetadata: WithReservationItemRequestBuilderRequestsMetadata,
30
+ pathParametersMappings: ["reservationId"],
31
+ },
32
+ };
33
+ /* tslint:enable */
34
+ /* eslint-enable */
@@ -0,0 +1,53 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ // Generated by Microsoft Kiota
4
+ // @ts-ignore
5
+ import { createOrderFromDiscriminatorValue, createProblemDetailsFromDiscriminatorValue, serializeClaimReservationRequest, serializeOrder, type ClaimReservationRequest, type Order, type ProblemDetails } from '../../../models/index.js';
6
+ // @ts-ignore
7
+ import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
8
+
9
+ /**
10
+ * Builds and executes requests for operations under /Order/claimReservation/{reservationId}
11
+ */
12
+ export interface WithReservationItemRequestBuilder extends BaseRequestBuilder<WithReservationItemRequestBuilder> {
13
+ /**
14
+ * A reservation must first be created using `POST /Reservation`. Once claimed, the reservation is finalized into an order and can no longer be reused.
15
+ * @param body Request to send when claiming a reservation
16
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
17
+ * @returns {Promise<Order>}
18
+ * @throws {ProblemDetails} error when the service returns a 400 status code
19
+ * @throws {ProblemDetails} error when the service returns a 500 status code
20
+ */
21
+ post(body: ClaimReservationRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<Order | undefined>;
22
+ /**
23
+ * A reservation must first be created using `POST /Reservation`. Once claimed, the reservation is finalized into an order and can no longer be reused.
24
+ * @param body Request to send when claiming a reservation
25
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
26
+ * @returns {RequestInformation}
27
+ */
28
+ toPostRequestInformation(body: ClaimReservationRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : RequestInformation;
29
+ }
30
+ /**
31
+ * Uri template for the request builder.
32
+ */
33
+ export const WithReservationItemRequestBuilderUriTemplate = "{+baseurl}/Order/claimReservation/{reservationId}";
34
+ /**
35
+ * Metadata for all the requests in the request builder.
36
+ */
37
+ export const WithReservationItemRequestBuilderRequestsMetadata: RequestsMetadata = {
38
+ post: {
39
+ uriTemplate: WithReservationItemRequestBuilderUriTemplate,
40
+ responseBodyContentType: "application/json, text/plain;q=0.9",
41
+ errorMappings: {
42
+ 400: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
43
+ 500: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
44
+ },
45
+ adapterMethodName: "send",
46
+ responseBodyFactory: createOrderFromDiscriminatorValue,
47
+ requestBodyContentType: "application/json",
48
+ requestBodySerializer: serializeClaimReservationRequest,
49
+ requestInformationContentSetMethod: "setContentFromParsable",
50
+ },
51
+ };
52
+ /* tslint:enable */
53
+ /* eslint-enable */
@@ -0,0 +1,53 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ // Generated by Microsoft Kiota
4
+ // @ts-ignore
5
+ import { createOrderFromDiscriminatorValue, createProblemDetailsFromDiscriminatorValue, serializeCreateOrderRequest, serializeOrder, type CreateOrderRequest, type Order, type ProblemDetails } from '../../models/index.js';
6
+ // @ts-ignore
7
+ import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
8
+
9
+ /**
10
+ * Builds and executes requests for operations under /Order/createOrder
11
+ */
12
+ export interface CreateOrderRequestBuilder extends BaseRequestBuilder<CreateOrderRequestBuilder> {
13
+ /**
14
+ * Available products can be retrieved using the GET Product endpoint. Available regions can be retrieved using the GET Region endpoint. Currency codes can't be mixed in a single order.Most fields in the MissionControl.Application.Sales.Dto.Partner.SalesPriceRequest are required, with a few exceptions:- VatDetail: Only one of its properties—Rate, Amount or PriceExcludingVat should be set explicitly. If more than one is provided, the system will raise a validation error. The remaining properties will be calculated automatically based on the value provided.- Sales channel: This is optional. If the key is sold directly to the end consumer, the sales channel can remain empty. However, if intermediaries are involved, their partner IDs must be listed in the correct order of distribution.- Deductions: This field is also optional. It can be used to record various fees, commissions, or discounts that may have affected the final sale amount. **Enhanced Capabilities (v2.0):** This endpoint supports all key suppliers, including those requiring additional information:- **Epay**: Requires end consumer language and returns redemption information (URL, description).
15
+ * @param body Request to create an order for buying a key.
16
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
17
+ * @returns {Promise<Order>}
18
+ * @throws {ProblemDetails} error when the service returns a 400 status code
19
+ * @throws {ProblemDetails} error when the service returns a 500 status code
20
+ */
21
+ post(body: CreateOrderRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<Order | undefined>;
22
+ /**
23
+ * Available products can be retrieved using the GET Product endpoint. Available regions can be retrieved using the GET Region endpoint. Currency codes can't be mixed in a single order.Most fields in the MissionControl.Application.Sales.Dto.Partner.SalesPriceRequest are required, with a few exceptions:- VatDetail: Only one of its properties—Rate, Amount or PriceExcludingVat should be set explicitly. If more than one is provided, the system will raise a validation error. The remaining properties will be calculated automatically based on the value provided.- Sales channel: This is optional. If the key is sold directly to the end consumer, the sales channel can remain empty. However, if intermediaries are involved, their partner IDs must be listed in the correct order of distribution.- Deductions: This field is also optional. It can be used to record various fees, commissions, or discounts that may have affected the final sale amount. **Enhanced Capabilities (v2.0):** This endpoint supports all key suppliers, including those requiring additional information:- **Epay**: Requires end consumer language and returns redemption information (URL, description).
24
+ * @param body Request to create an order for buying a key.
25
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
26
+ * @returns {RequestInformation}
27
+ */
28
+ toPostRequestInformation(body: CreateOrderRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : RequestInformation;
29
+ }
30
+ /**
31
+ * Uri template for the request builder.
32
+ */
33
+ export const CreateOrderRequestBuilderUriTemplate = "{+baseurl}/Order/createOrder";
34
+ /**
35
+ * Metadata for all the requests in the request builder.
36
+ */
37
+ export const CreateOrderRequestBuilderRequestsMetadata: RequestsMetadata = {
38
+ post: {
39
+ uriTemplate: CreateOrderRequestBuilderUriTemplate,
40
+ responseBodyContentType: "application/json, text/plain;q=0.9",
41
+ errorMappings: {
42
+ 400: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
43
+ 500: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
44
+ },
45
+ adapterMethodName: "send",
46
+ responseBodyFactory: createOrderFromDiscriminatorValue,
47
+ requestBodyContentType: "application/json",
48
+ requestBodySerializer: serializeCreateOrderRequest,
49
+ requestInformationContentSetMethod: "setContentFromParsable",
50
+ },
51
+ };
52
+ /* tslint:enable */
53
+ /* eslint-enable */
@@ -0,0 +1,112 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ // Generated by Microsoft Kiota
4
+ // @ts-ignore
5
+ import { createOrderListResultFromDiscriminatorValue, createProblemDetailsFromDiscriminatorValue, type OrderListResult, type ProblemDetails } from '../models/index.js';
6
+ // @ts-ignore
7
+ import { CancelOrderRequestBuilderRequestsMetadata, type CancelOrderRequestBuilder } from './cancelOrder/index.js';
8
+ // @ts-ignore
9
+ import { ClaimReservationRequestBuilderNavigationMetadata, type ClaimReservationRequestBuilder } from './claimReservation/index.js';
10
+ // @ts-ignore
11
+ import { CreateOrderRequestBuilderRequestsMetadata, type CreateOrderRequestBuilder } from './createOrder/index.js';
12
+ // @ts-ignore
13
+ import { ReportOrderRequestBuilderRequestsMetadata, type ReportOrderRequestBuilder } from './reportOrder/index.js';
14
+ // @ts-ignore
15
+ import { type BaseRequestBuilder, type Guid, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
16
+
17
+ /**
18
+ * Builds and executes requests for operations under /Order
19
+ */
20
+ export interface OrderRequestBuilder extends BaseRequestBuilder<OrderRequestBuilder> {
21
+ /**
22
+ * The cancelOrder property
23
+ */
24
+ get cancelOrder(): CancelOrderRequestBuilder;
25
+ /**
26
+ * The claimReservation property
27
+ */
28
+ get claimReservation(): ClaimReservationRequestBuilder;
29
+ /**
30
+ * The createOrder property
31
+ */
32
+ get createOrder(): CreateOrderRequestBuilder;
33
+ /**
34
+ * The reportOrder property
35
+ */
36
+ get reportOrder(): ReportOrderRequestBuilder;
37
+ /**
38
+ * Note 1: For performance reasons, there is a slight delay in the visibility of orders after they are created. Note 2: This endpoint uses pagination by default, meaning it may not return all orders in a single response. Please refer to pagination details for handling result sets.
39
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
40
+ * @returns {Promise<OrderListResult>}
41
+ * @throws {ProblemDetails} error when the service returns a 400 status code
42
+ * @throws {ProblemDetails} error when the service returns a 500 status code
43
+ */
44
+ get(requestConfiguration?: RequestConfiguration<OrderRequestBuilderGetQueryParameters> | undefined) : Promise<OrderListResult | undefined>;
45
+ /**
46
+ * Note 1: For performance reasons, there is a slight delay in the visibility of orders after they are created. Note 2: This endpoint uses pagination by default, meaning it may not return all orders in a single response. Please refer to pagination details for handling result sets.
47
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
48
+ * @returns {RequestInformation}
49
+ */
50
+ toGetRequestInformation(requestConfiguration?: RequestConfiguration<OrderRequestBuilderGetQueryParameters> | undefined) : RequestInformation;
51
+ }
52
+ /**
53
+ * Note 1: For performance reasons, there is a slight delay in the visibility of orders after they are created. Note 2: This endpoint uses pagination by default, meaning it may not return all orders in a single response. Please refer to pagination details for handling result sets.
54
+ */
55
+ export interface OrderRequestBuilderGetQueryParameters {
56
+ /**
57
+ * Optional filter to retrieve a single order by Identifier.
58
+ */
59
+ orderId?: Guid;
60
+ pageIndex?: number;
61
+ pageSize?: number;
62
+ /**
63
+ * Optional filter to retrieve all orders with a matching partner reference, as provided by you when creating the order.
64
+ */
65
+ partnerReference?: string;
66
+ /**
67
+ * The ID of the publisher for which to retrieve the orders. A list of available publishers can be retrieved using the GET Publisher endpoint.
68
+ */
69
+ publisherId?: Guid;
70
+ /**
71
+ * Optional filter to retrieve a single order by request id, as assigned when creating the order.
72
+ */
73
+ requestId?: Guid;
74
+ }
75
+ /**
76
+ * Uri template for the request builder.
77
+ */
78
+ export const OrderRequestBuilderUriTemplate = "{+baseurl}/Order?publisherId={publisherId}{&orderId*,pageIndex*,pageSize*,partnerReference*,requestId*}";
79
+ /**
80
+ * Metadata for all the navigation properties in the request builder.
81
+ */
82
+ export const OrderRequestBuilderNavigationMetadata: Record<Exclude<keyof OrderRequestBuilder, KeysToExcludeForNavigationMetadata>, NavigationMetadata> = {
83
+ cancelOrder: {
84
+ requestsMetadata: CancelOrderRequestBuilderRequestsMetadata,
85
+ },
86
+ claimReservation: {
87
+ navigationMetadata: ClaimReservationRequestBuilderNavigationMetadata,
88
+ },
89
+ createOrder: {
90
+ requestsMetadata: CreateOrderRequestBuilderRequestsMetadata,
91
+ },
92
+ reportOrder: {
93
+ requestsMetadata: ReportOrderRequestBuilderRequestsMetadata,
94
+ },
95
+ };
96
+ /**
97
+ * Metadata for all the requests in the request builder.
98
+ */
99
+ export const OrderRequestBuilderRequestsMetadata: RequestsMetadata = {
100
+ get: {
101
+ uriTemplate: OrderRequestBuilderUriTemplate,
102
+ responseBodyContentType: "application/json, text/plain;q=0.9",
103
+ errorMappings: {
104
+ 400: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
105
+ 500: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
106
+ },
107
+ adapterMethodName: "send",
108
+ responseBodyFactory: createOrderListResultFromDiscriminatorValue,
109
+ },
110
+ };
111
+ /* tslint:enable */
112
+ /* eslint-enable */
@@ -0,0 +1,53 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ // Generated by Microsoft Kiota
4
+ // @ts-ignore
5
+ import { createOrderFromDiscriminatorValue, createProblemDetailsFromDiscriminatorValue, serializeOrder, serializeReportOrderRequest, type Order, type ProblemDetails, type ReportOrderRequest } from '../../models/index.js';
6
+ // @ts-ignore
7
+ import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
8
+
9
+ /**
10
+ * Builds and executes requests for operations under /Order/reportOrder
11
+ */
12
+ export interface ReportOrderRequestBuilder extends BaseRequestBuilder<ReportOrderRequestBuilder> {
13
+ /**
14
+ * Available products can be retrieved using the GET Product endpoint. Currency codes can't be mixed in a single order.Most fields in the MissionControl.Application.Sales.Dto.Partner.SalesPriceRequest are required, with a few exceptions:- VatDetail: Only one of its properties—Rate, Amount or PriceExcludingVat should be set explicitly. If more than one is provided, the system will raise a validation error. The remaining properties will be calculated automatically based on the value provided.- Sales channel: This is optional. If the key is sold directly to the end consumer, the sales channel can remain empty. However, if intermediaries are involved, their partner IDs must be listed in the correct order of distribution.- Deductions: This field is also optional. It can be used to record various fees, commissions, or discounts that may have affected the final sale amount.
15
+ * @param body Request to send when reporting an order. No key will be delivered by this API.
16
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
17
+ * @returns {Promise<Order>}
18
+ * @throws {ProblemDetails} error when the service returns a 400 status code
19
+ * @throws {ProblemDetails} error when the service returns a 500 status code
20
+ */
21
+ post(body: ReportOrderRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<Order | undefined>;
22
+ /**
23
+ * Available products can be retrieved using the GET Product endpoint. Currency codes can't be mixed in a single order.Most fields in the MissionControl.Application.Sales.Dto.Partner.SalesPriceRequest are required, with a few exceptions:- VatDetail: Only one of its properties—Rate, Amount or PriceExcludingVat should be set explicitly. If more than one is provided, the system will raise a validation error. The remaining properties will be calculated automatically based on the value provided.- Sales channel: This is optional. If the key is sold directly to the end consumer, the sales channel can remain empty. However, if intermediaries are involved, their partner IDs must be listed in the correct order of distribution.- Deductions: This field is also optional. It can be used to record various fees, commissions, or discounts that may have affected the final sale amount.
24
+ * @param body Request to send when reporting an order. No key will be delivered by this API.
25
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
26
+ * @returns {RequestInformation}
27
+ */
28
+ toPostRequestInformation(body: ReportOrderRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : RequestInformation;
29
+ }
30
+ /**
31
+ * Uri template for the request builder.
32
+ */
33
+ export const ReportOrderRequestBuilderUriTemplate = "{+baseurl}/Order/reportOrder";
34
+ /**
35
+ * Metadata for all the requests in the request builder.
36
+ */
37
+ export const ReportOrderRequestBuilderRequestsMetadata: RequestsMetadata = {
38
+ post: {
39
+ uriTemplate: ReportOrderRequestBuilderUriTemplate,
40
+ responseBodyContentType: "application/json, text/plain;q=0.9",
41
+ errorMappings: {
42
+ 400: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
43
+ 500: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
44
+ },
45
+ adapterMethodName: "send",
46
+ responseBodyFactory: createOrderFromDiscriminatorValue,
47
+ requestBodyContentType: "application/json",
48
+ requestBodySerializer: serializeReportOrderRequest,
49
+ requestInformationContentSetMethod: "setContentFromParsable",
50
+ },
51
+ };
52
+ /* tslint:enable */
53
+ /* eslint-enable */
@@ -0,0 +1,55 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ // Generated by Microsoft Kiota
4
+ // @ts-ignore
5
+ import { createPartnerListResultFromDiscriminatorValue, createProblemDetailsFromDiscriminatorValue, type PartnerListResult, type ProblemDetails } from '../models/index.js';
6
+ // @ts-ignore
7
+ import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
8
+
9
+ /**
10
+ * Builds and executes requests for operations under /Partner
11
+ */
12
+ export interface PartnerRequestBuilder extends BaseRequestBuilder<PartnerRequestBuilder> {
13
+ /**
14
+ * Retrieves a paginated list of all available partners.Use pagination parameters to specify the pagesize and the current page number to retrieve the desired subset of partners.
15
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
16
+ * @returns {Promise<PartnerListResult>}
17
+ * @throws {ProblemDetails} error when the service returns a 400 status code
18
+ * @throws {ProblemDetails} error when the service returns a 500 status code
19
+ */
20
+ get(requestConfiguration?: RequestConfiguration<PartnerRequestBuilderGetQueryParameters> | undefined) : Promise<PartnerListResult | undefined>;
21
+ /**
22
+ * Retrieves a paginated list of all available partners.Use pagination parameters to specify the pagesize and the current page number to retrieve the desired subset of partners.
23
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
24
+ * @returns {RequestInformation}
25
+ */
26
+ toGetRequestInformation(requestConfiguration?: RequestConfiguration<PartnerRequestBuilderGetQueryParameters> | undefined) : RequestInformation;
27
+ }
28
+ /**
29
+ * Retrieves a paginated list of all available partners.Use pagination parameters to specify the pagesize and the current page number to retrieve the desired subset of partners.
30
+ */
31
+ export interface PartnerRequestBuilderGetQueryParameters {
32
+ pageIndex?: number;
33
+ pageSize?: number;
34
+ }
35
+ /**
36
+ * Uri template for the request builder.
37
+ */
38
+ export const PartnerRequestBuilderUriTemplate = "{+baseurl}/Partner{?pageIndex*,pageSize*}";
39
+ /**
40
+ * Metadata for all the requests in the request builder.
41
+ */
42
+ export const PartnerRequestBuilderRequestsMetadata: RequestsMetadata = {
43
+ get: {
44
+ uriTemplate: PartnerRequestBuilderUriTemplate,
45
+ responseBodyContentType: "application/json, text/plain;q=0.9",
46
+ errorMappings: {
47
+ 400: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
48
+ 500: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
49
+ },
50
+ adapterMethodName: "send",
51
+ responseBodyFactory: createPartnerListResultFromDiscriminatorValue,
52
+ },
53
+ };
54
+ /* tslint:enable */
55
+ /* eslint-enable */
@@ -0,0 +1,55 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ // Generated by Microsoft Kiota
4
+ // @ts-ignore
5
+ import { createPriceListFromDiscriminatorValue, createProblemDetailsFromDiscriminatorValue, type PriceList, type ProblemDetails } from '../models/index.js';
6
+ // @ts-ignore
7
+ import { type BaseRequestBuilder, type Guid, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
8
+
9
+ /**
10
+ * Builds and executes requests for operations under /PriceList
11
+ */
12
+ export interface PriceListRequestBuilder extends BaseRequestBuilder<PriceListRequestBuilder> {
13
+ /**
14
+ * Gets a pricelist for a product.
15
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
16
+ * @returns {Promise<PriceList>}
17
+ * @throws {ProblemDetails} error when the service returns a 400 status code
18
+ * @throws {ProblemDetails} error when the service returns a 500 status code
19
+ */
20
+ get(requestConfiguration?: RequestConfiguration<PriceListRequestBuilderGetQueryParameters> | undefined) : Promise<PriceList | undefined>;
21
+ /**
22
+ * Gets a pricelist for a product.
23
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
24
+ * @returns {RequestInformation}
25
+ */
26
+ toGetRequestInformation(requestConfiguration?: RequestConfiguration<PriceListRequestBuilderGetQueryParameters> | undefined) : RequestInformation;
27
+ }
28
+ /**
29
+ * Gets a pricelist for a product.
30
+ */
31
+ export interface PriceListRequestBuilderGetQueryParameters {
32
+ productId?: Guid;
33
+ publisherId?: Guid;
34
+ }
35
+ /**
36
+ * Uri template for the request builder.
37
+ */
38
+ export const PriceListRequestBuilderUriTemplate = "{+baseurl}/PriceList?productId={productId}&publisherId={publisherId}";
39
+ /**
40
+ * Metadata for all the requests in the request builder.
41
+ */
42
+ export const PriceListRequestBuilderRequestsMetadata: RequestsMetadata = {
43
+ get: {
44
+ uriTemplate: PriceListRequestBuilderUriTemplate,
45
+ responseBodyContentType: "application/json, text/plain;q=0.9",
46
+ errorMappings: {
47
+ 400: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
48
+ 500: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
49
+ },
50
+ adapterMethodName: "send",
51
+ responseBodyFactory: createPriceListFromDiscriminatorValue,
52
+ },
53
+ };
54
+ /* tslint:enable */
55
+ /* eslint-enable */
@@ -0,0 +1,53 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ // Generated by Microsoft Kiota
4
+ // @ts-ignore
5
+ import { createHasStockResponseFromDiscriminatorValue, createProblemDetailsFromDiscriminatorValue, serializeHasStockRequest, serializeHasStockResponse, type HasStockRequest, type HasStockResponse, type ProblemDetails } from '../../models/index.js';
6
+ // @ts-ignore
7
+ import { type BaseRequestBuilder, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
8
+
9
+ /**
10
+ * Builds and executes requests for operations under /Product/hasStock
11
+ */
12
+ export interface HasStockRequestBuilder extends BaseRequestBuilder<HasStockRequestBuilder> {
13
+ /**
14
+ * Checks if a product has stock.
15
+ * @param body Request to send to check if a product has stock.
16
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
17
+ * @returns {Promise<HasStockResponse>}
18
+ * @throws {ProblemDetails} error when the service returns a 400 status code
19
+ * @throws {ProblemDetails} error when the service returns a 500 status code
20
+ */
21
+ post(body: HasStockRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : Promise<HasStockResponse | undefined>;
22
+ /**
23
+ * Checks if a product has stock.
24
+ * @param body Request to send to check if a product has stock.
25
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
26
+ * @returns {RequestInformation}
27
+ */
28
+ toPostRequestInformation(body: HasStockRequest, requestConfiguration?: RequestConfiguration<object> | undefined) : RequestInformation;
29
+ }
30
+ /**
31
+ * Uri template for the request builder.
32
+ */
33
+ export const HasStockRequestBuilderUriTemplate = "{+baseurl}/Product/hasStock";
34
+ /**
35
+ * Metadata for all the requests in the request builder.
36
+ */
37
+ export const HasStockRequestBuilderRequestsMetadata: RequestsMetadata = {
38
+ post: {
39
+ uriTemplate: HasStockRequestBuilderUriTemplate,
40
+ responseBodyContentType: "application/json, text/plain;q=0.9",
41
+ errorMappings: {
42
+ 400: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
43
+ 500: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
44
+ },
45
+ adapterMethodName: "send",
46
+ responseBodyFactory: createHasStockResponseFromDiscriminatorValue,
47
+ requestBodyContentType: "application/json",
48
+ requestBodySerializer: serializeHasStockRequest,
49
+ requestInformationContentSetMethod: "setContentFromParsable",
50
+ },
51
+ };
52
+ /* tslint:enable */
53
+ /* eslint-enable */
@@ -0,0 +1,119 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ // Generated by Microsoft Kiota
4
+ // @ts-ignore
5
+ import { createProblemDetailsFromDiscriminatorValue, createProductListResultFromDiscriminatorValue, type ProblemDetails, type ProductListResult } from '../models/index.js';
6
+ // @ts-ignore
7
+ import { HasStockRequestBuilderRequestsMetadata, type HasStockRequestBuilder } from './hasStock/index.js';
8
+ // @ts-ignore
9
+ import { type BaseRequestBuilder, type Guid, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type Parsable, type ParsableFactory, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
10
+
11
+ export type GetSortByQueryParameterType = (typeof GetSortByQueryParameterTypeObject)[keyof typeof GetSortByQueryParameterTypeObject];
12
+ export type GetSortDirectionQueryParameterType = (typeof GetSortDirectionQueryParameterTypeObject)[keyof typeof GetSortDirectionQueryParameterTypeObject];
13
+ /**
14
+ * Builds and executes requests for operations under /Product
15
+ */
16
+ export interface ProductRequestBuilder extends BaseRequestBuilder<ProductRequestBuilder> {
17
+ /**
18
+ * The hasStock property
19
+ */
20
+ get hasStock(): HasStockRequestBuilder;
21
+ /**
22
+ * Retrieves all products available.
23
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
24
+ * @returns {Promise<ProductListResult>}
25
+ * @throws {ProblemDetails} error when the service returns a 400 status code
26
+ * @throws {ProblemDetails} error when the service returns a 500 status code
27
+ */
28
+ get(requestConfiguration?: RequestConfiguration<ProductRequestBuilderGetQueryParameters> | undefined) : Promise<ProductListResult | undefined>;
29
+ /**
30
+ * Retrieves all products available.
31
+ * @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
32
+ * @returns {RequestInformation}
33
+ */
34
+ toGetRequestInformation(requestConfiguration?: RequestConfiguration<ProductRequestBuilderGetQueryParameters> | undefined) : RequestInformation;
35
+ }
36
+ /**
37
+ * Retrieves all products available.
38
+ */
39
+ export interface ProductRequestBuilderGetQueryParameters {
40
+ /**
41
+ * Optional ISO 3166-1 alpha-2 country code to filter products and regions.When provided, only products with regions that include the specified country will be returned.If null or empty, no country filtering is applied.
42
+ */
43
+ countryCode?: string;
44
+ /**
45
+ * Optional flag to include MSRP information in the response.When true and MissionControl.Application.Products.Dto.Partner.GetProductsRequest.CountryCode is provided, MSRP for the specified country will be included for each product if configured.This property is only effective when MissionControl.Application.Products.Dto.Partner.GetProductsRequest.CountryCode is also specified.Default is false.
46
+ */
47
+ includeMsrp?: boolean;
48
+ /**
49
+ * Optional search term to find products by name.Performs a partial, case-insensitive match against product names.If null or empty, no name filtering is applied.
50
+ */
51
+ name?: string;
52
+ pageIndex?: number;
53
+ pageSize?: number;
54
+ /**
55
+ * Optional list of product IDs to filter products by.Only products with IDs in this list will be returned.If empty, products with all IDs are included.Maximum 50 items allowed.
56
+ */
57
+ productId?: Guid[];
58
+ /**
59
+ * Optional list of publisher IDs to filter products by.Only products from publishers in this list will be returned.If empty, products from all publishers are included.Maximum 50 items allowed.
60
+ */
61
+ publisherId?: Guid[];
62
+ /**
63
+ * Field to sort by
64
+ */
65
+ sortBy?: GetSortByQueryParameterType;
66
+ /**
67
+ * Direction to sort on
68
+ */
69
+ sortDirection?: GetSortDirectionQueryParameterType;
70
+ }
71
+ /**
72
+ * Uri template for the request builder.
73
+ */
74
+ export const ProductRequestBuilderUriTemplate = "{+baseurl}/Product{?CountryCode*,IncludeMsrp*,Name*,ProductId*,PublisherId*,pageIndex*,pageSize*,sortBy*,sortDirection*}";
75
+ export const GetSortByQueryParameterTypeObject = {
76
+ Name: "name",
77
+ ProductTypeId: "productTypeId",
78
+ ReleaseDate: "releaseDate",
79
+ } as const;
80
+ export const GetSortDirectionQueryParameterTypeObject = {
81
+ ASC: "ASC",
82
+ DESC: "DESC",
83
+ } as const;
84
+ /**
85
+ * Mapper for query parameters from symbol name to serialization name represented as a constant.
86
+ */
87
+ const ProductRequestBuilderGetQueryParametersMapper: Record<string, string> = {
88
+ "countryCode": "CountryCode",
89
+ "includeMsrp": "IncludeMsrp",
90
+ "name": "Name",
91
+ "productId": "ProductId",
92
+ "publisherId": "PublisherId",
93
+ };
94
+ /**
95
+ * Metadata for all the navigation properties in the request builder.
96
+ */
97
+ export const ProductRequestBuilderNavigationMetadata: Record<Exclude<keyof ProductRequestBuilder, KeysToExcludeForNavigationMetadata>, NavigationMetadata> = {
98
+ hasStock: {
99
+ requestsMetadata: HasStockRequestBuilderRequestsMetadata,
100
+ },
101
+ };
102
+ /**
103
+ * Metadata for all the requests in the request builder.
104
+ */
105
+ export const ProductRequestBuilderRequestsMetadata: RequestsMetadata = {
106
+ get: {
107
+ uriTemplate: ProductRequestBuilderUriTemplate,
108
+ responseBodyContentType: "application/json, text/plain;q=0.9",
109
+ errorMappings: {
110
+ 400: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
111
+ 500: createProblemDetailsFromDiscriminatorValue as ParsableFactory<Parsable>,
112
+ },
113
+ adapterMethodName: "send",
114
+ responseBodyFactory: createProductListResultFromDiscriminatorValue,
115
+ queryParametersMapper: ProductRequestBuilderGetQueryParametersMapper,
116
+ },
117
+ };
118
+ /* tslint:enable */
119
+ /* eslint-enable */