@missioncontrolio/client 0.0.9 → 0.0.10

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 (90) hide show
  1. package/dist/client/autoCancelOrderHandler.d.ts +7 -0
  2. package/dist/client/autoCancelOrderHandler.js +95 -0
  3. package/dist/client/clientBuilder.d.ts +16 -0
  4. package/dist/client/clientBuilder.js +57 -0
  5. package/dist/client/generated/client.d.ts +20 -0
  6. package/{src/client/generated/client.ts → dist/client/generated/client.js} +14 -79
  7. package/dist/client/generated/models/index.d.ts +277 -0
  8. package/dist/client/generated/models/index.js +585 -0
  9. package/dist/client/generated/order/cancelOrder/index.d.ts +8 -0
  10. package/dist/client/generated/order/cancelOrder/index.js +17 -0
  11. package/dist/client/generated/order/claimReservation/index.d.ts +7 -0
  12. package/dist/client/generated/order/claimReservation/index.js +8 -0
  13. package/dist/client/generated/order/claimReservation/item/index.d.ts +8 -0
  14. package/dist/client/generated/order/claimReservation/item/index.js +17 -0
  15. package/dist/client/generated/order/createOrder/index.d.ts +8 -0
  16. package/dist/client/generated/order/createOrder/index.js +17 -0
  17. package/dist/client/generated/order/index.d.ts +25 -0
  18. package/dist/client/generated/order/index.js +32 -0
  19. package/dist/client/generated/order/reportOrder/index.d.ts +8 -0
  20. package/dist/client/generated/order/reportOrder/index.js +17 -0
  21. package/dist/client/generated/partner/index.d.ts +12 -0
  22. package/dist/client/generated/partner/index.js +14 -0
  23. package/dist/client/generated/priceList/index.d.ts +12 -0
  24. package/dist/client/generated/priceList/index.js +14 -0
  25. package/dist/client/generated/product/hasStock/index.d.ts +8 -0
  26. package/dist/client/generated/product/hasStock/index.js +17 -0
  27. package/dist/client/generated/product/index.d.ts +33 -0
  28. package/dist/client/generated/product/index.js +37 -0
  29. package/dist/client/generated/publisher/index.d.ts +12 -0
  30. package/dist/client/generated/publisher/index.js +14 -0
  31. package/dist/client/generated/region/index.d.ts +14 -0
  32. package/dist/client/generated/region/index.js +14 -0
  33. package/dist/client/generated/reservation/index.d.ts +11 -0
  34. package/dist/client/generated/reservation/index.js +25 -0
  35. package/dist/client/generated/reservation/item/cancel/index.d.ts +8 -0
  36. package/dist/client/generated/reservation/item/cancel/index.js +14 -0
  37. package/dist/client/generated/reservation/item/index.d.ts +11 -0
  38. package/dist/client/generated/reservation/item/index.js +20 -0
  39. package/dist/client/missionControlEnvironment.d.ts +6 -0
  40. package/dist/client/missionControlEnvironment.js +21 -0
  41. package/dist/client/missionControlHandlers.d.ts +2 -0
  42. package/dist/client/missionControlHandlers.js +34 -0
  43. package/dist/client/missionControlHeaders.d.ts +3 -0
  44. package/dist/client/missionControlHeaders.js +3 -0
  45. package/dist/client/nonIdempotentPaths.d.ts +1 -0
  46. package/dist/client/nonIdempotentPaths.js +5 -0
  47. package/dist/client/partnerIdHandler.d.ts +8 -0
  48. package/dist/client/partnerIdHandler.js +14 -0
  49. package/dist/index.d.ts +5 -0
  50. package/dist/index.js +3 -0
  51. package/package.json +15 -3
  52. package/.env.local.example +0 -9
  53. package/src/client/autoCancelOrderHandler.ts +0 -135
  54. package/src/client/clientBuilder.ts +0 -139
  55. package/src/client/generated/kiota-lock.json +0 -34
  56. package/src/client/generated/models/index.ts +0 -1723
  57. package/src/client/generated/order/cancelOrder/index.ts +0 -53
  58. package/src/client/generated/order/claimReservation/index.ts +0 -34
  59. package/src/client/generated/order/claimReservation/item/index.ts +0 -53
  60. package/src/client/generated/order/createOrder/index.ts +0 -53
  61. package/src/client/generated/order/index.ts +0 -112
  62. package/src/client/generated/order/reportOrder/index.ts +0 -53
  63. package/src/client/generated/partner/index.ts +0 -55
  64. package/src/client/generated/priceList/index.ts +0 -55
  65. package/src/client/generated/product/hasStock/index.ts +0 -53
  66. package/src/client/generated/product/index.ts +0 -119
  67. package/src/client/generated/publisher/index.ts +0 -55
  68. package/src/client/generated/region/index.ts +0 -63
  69. package/src/client/generated/reservation/index.ts +0 -71
  70. package/src/client/generated/reservation/item/cancel/index.ts +0 -48
  71. package/src/client/generated/reservation/item/index.ts +0 -62
  72. package/src/client/missionControlEnvironment.ts +0 -32
  73. package/src/client/missionControlHandlers.ts +0 -61
  74. package/src/client/missionControlHeaders.ts +0 -10
  75. package/src/client/nonIdempotentPaths.ts +0 -9
  76. package/src/client/partnerIdHandler.ts +0 -33
  77. package/tests/autoCancelOrderHandler.test.ts +0 -263
  78. package/tests/clientBuilder.test.ts +0 -154
  79. package/tests/integration/fixture.ts +0 -50
  80. package/tests/integration/partner.test.ts +0 -32
  81. package/tests/integration/priceList.test.ts +0 -28
  82. package/tests/integration/product.test.ts +0 -30
  83. package/tests/integration/publisher.test.ts +0 -30
  84. package/tests/integration/region.test.ts +0 -36
  85. package/tests/integration/setup.ts +0 -22
  86. package/tests/missionControlEnvironment.test.ts +0 -66
  87. package/tests/missionControlHeaders.test.ts +0 -20
  88. package/tsconfig.json +0 -18
  89. package/vitest.config.ts +0 -8
  90. package/vitest.integration.config.ts +0 -9
@@ -0,0 +1,7 @@
1
+ import type { RequestOption } from "@microsoft/kiota-abstractions";
2
+ import type { Middleware } from "@microsoft/kiota-http-fetchlibrary";
3
+ export declare class AutoCancelOrderHandler implements Middleware {
4
+ next: Middleware | undefined;
5
+ execute(url: string, requestInit: RequestInit, requestOptions?: Record<string, RequestOption>): Promise<Response>;
6
+ private tryCancelOrderAsync;
7
+ }
@@ -0,0 +1,95 @@
1
+ import { MissionControlHeaders } from "./missionControlHeaders.js";
2
+ import { nonIdempotentPaths } from "./nonIdempotentPaths.js";
3
+ const CANCEL_TIMEOUT_MS = 30000;
4
+ export class AutoCancelOrderHandler {
5
+ async execute(url, requestInit, requestOptions) {
6
+ if (!isAutoCancelEndpoint(url)) {
7
+ return this.next.execute(url, requestInit, requestOptions);
8
+ }
9
+ const requestBody = requestInit.body != null ? String(requestInit.body) : null;
10
+ let response;
11
+ try {
12
+ response = await this.next.execute(url, requestInit, requestOptions);
13
+ }
14
+ catch (err) {
15
+ await this.tryCancelOrderAsync(url, requestInit, requestBody);
16
+ throw err;
17
+ }
18
+ if (isServerError(response)) {
19
+ await this.tryCancelOrderAsync(url, requestInit, requestBody);
20
+ }
21
+ return response;
22
+ }
23
+ async tryCancelOrderAsync(originalUrl, originalInit, requestBody) {
24
+ try {
25
+ const requestId = extractRequestId(requestBody);
26
+ if (requestId == null)
27
+ return;
28
+ const cancelUrl = buildCancelUrl(originalUrl);
29
+ if (cancelUrl == null)
30
+ return;
31
+ const headers = new Headers();
32
+ headers.set("Content-Type", "application/json");
33
+ const originalHeaders = new Headers(originalInit.headers);
34
+ const auth = originalHeaders.get("Authorization");
35
+ if (auth)
36
+ headers.set("Authorization", auth);
37
+ const partnerId = originalHeaders.get(MissionControlHeaders.PartnerId);
38
+ if (partnerId)
39
+ headers.set(MissionControlHeaders.PartnerId, partnerId);
40
+ const cancelInit = {
41
+ method: "POST",
42
+ headers,
43
+ body: JSON.stringify({ originalRequestId: requestId }),
44
+ signal: AbortSignal.timeout(CANCEL_TIMEOUT_MS),
45
+ };
46
+ await this.next.execute(cancelUrl, cancelInit, undefined);
47
+ }
48
+ catch {
49
+ }
50
+ }
51
+ }
52
+ function isAutoCancelEndpoint(url) {
53
+ try {
54
+ const path = new URL(url).pathname;
55
+ return nonIdempotentPaths.some((prefix) => path.toLowerCase().includes(prefix.toLowerCase()));
56
+ }
57
+ catch {
58
+ return false;
59
+ }
60
+ }
61
+ function isServerError(response) {
62
+ return response.status >= 500;
63
+ }
64
+ function extractRequestId(json) {
65
+ if (!json)
66
+ return null;
67
+ try {
68
+ const parsed = JSON.parse(json);
69
+ if (parsed != null &&
70
+ typeof parsed === "object" &&
71
+ "requestId" in parsed &&
72
+ typeof parsed.requestId === "string") {
73
+ return parsed.requestId;
74
+ }
75
+ }
76
+ catch {
77
+ }
78
+ return null;
79
+ }
80
+ function buildCancelUrl(url) {
81
+ try {
82
+ const parsed = new URL(url);
83
+ const path = parsed.pathname;
84
+ const orderIndex = path.toLowerCase().indexOf("/order/");
85
+ if (orderIndex < 0)
86
+ return null;
87
+ parsed.pathname =
88
+ path.slice(0, orderIndex + "/Order/".length) + "cancelOrder";
89
+ parsed.search = "";
90
+ return parsed.toString();
91
+ }
92
+ catch {
93
+ return null;
94
+ }
95
+ }
@@ -0,0 +1,16 @@
1
+ import { MissionControlEnvironment } from "./missionControlEnvironment.js";
2
+ import { type Client } from "./generated/client.js";
3
+ export declare class ClientBuilder {
4
+ private _baseUrl;
5
+ private _scope;
6
+ private _tenantId;
7
+ private _clientId?;
8
+ private _clientSecret?;
9
+ private _defaultPartnerId?;
10
+ withDefaultPartnerId(partnerId: string): this;
11
+ withBaseUrl(baseUrl: string): this;
12
+ withScope(scope: string): this;
13
+ forEnvironment(environment: MissionControlEnvironment): this;
14
+ withAzureAdClientCredentials(clientId: string, clientSecret: string, tenantId?: string): this;
15
+ build(): Client;
16
+ }
@@ -0,0 +1,57 @@
1
+ import { ClientSecretCredential } from "@azure/identity";
2
+ import { AzureIdentityAuthenticationProvider } from "@microsoft/kiota-authentication-azure";
3
+ import { FetchRequestAdapter, KiotaClientFactory, } from "@microsoft/kiota-http-fetchlibrary";
4
+ import { getBaseUrl, getScope, MissionControlEnvironment, } from "./missionControlEnvironment.js";
5
+ import { createClient } from "./generated/client.js";
6
+ import { createHandlers } from "./missionControlHandlers.js";
7
+ export class ClientBuilder {
8
+ constructor() {
9
+ this._baseUrl = getBaseUrl(MissionControlEnvironment.Production);
10
+ this._scope = getScope(MissionControlEnvironment.Production);
11
+ this._tenantId = "13d084c1-d072-41f2-878b-c45ca721c9f6";
12
+ }
13
+ withDefaultPartnerId(partnerId) {
14
+ if (!partnerId?.trim())
15
+ throw new Error("partnerId must not be null or whitespace.");
16
+ this._defaultPartnerId = partnerId;
17
+ return this;
18
+ }
19
+ withBaseUrl(baseUrl) {
20
+ if (!baseUrl?.trim())
21
+ throw new Error("baseUrl must not be null or whitespace.");
22
+ this._baseUrl = baseUrl;
23
+ return this;
24
+ }
25
+ withScope(scope) {
26
+ if (!scope?.trim())
27
+ throw new Error("scope must not be null or whitespace.");
28
+ this._scope = scope;
29
+ return this;
30
+ }
31
+ forEnvironment(environment) {
32
+ this._baseUrl = getBaseUrl(environment);
33
+ this._scope = getScope(environment);
34
+ return this;
35
+ }
36
+ withAzureAdClientCredentials(clientId, clientSecret, tenantId) {
37
+ this._clientId = clientId;
38
+ this._clientSecret = clientSecret;
39
+ if (tenantId)
40
+ this._tenantId = tenantId;
41
+ return this;
42
+ }
43
+ build() {
44
+ if (!this._clientId || !this._clientSecret) {
45
+ throw new Error("No credentials configured. " +
46
+ "Call withAzureAdClientCredentials() before calling build().");
47
+ }
48
+ const credential = new ClientSecretCredential(this._tenantId, this._clientId, this._clientSecret);
49
+ const allowedHosts = new Set([new URL(this._baseUrl).host]);
50
+ const authProvider = new AzureIdentityAuthenticationProvider(credential, [this._scope], undefined, allowedHosts);
51
+ const middlewares = createHandlers(this._defaultPartnerId);
52
+ const httpClient = KiotaClientFactory.create(undefined, middlewares);
53
+ const adapter = new FetchRequestAdapter(authProvider, undefined, undefined, httpClient);
54
+ adapter.baseUrl = this._baseUrl;
55
+ return createClient(adapter);
56
+ }
57
+ }
@@ -0,0 +1,20 @@
1
+ import { type OrderRequestBuilder } from './order/index.js';
2
+ import { type PartnerRequestBuilder } from './partner/index.js';
3
+ import { type PriceListRequestBuilder } from './priceList/index.js';
4
+ import { type ProductRequestBuilder } from './product/index.js';
5
+ import { type PublisherRequestBuilder } from './publisher/index.js';
6
+ import { type RegionRequestBuilder } from './region/index.js';
7
+ import { type ReservationRequestBuilder } from './reservation/index.js';
8
+ import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type RequestAdapter } from '@microsoft/kiota-abstractions';
9
+ export interface Client extends BaseRequestBuilder<Client> {
10
+ get order(): OrderRequestBuilder;
11
+ get partner(): PartnerRequestBuilder;
12
+ get priceList(): PriceListRequestBuilder;
13
+ get product(): ProductRequestBuilder;
14
+ get publisher(): PublisherRequestBuilder;
15
+ get region(): RegionRequestBuilder;
16
+ get reservation(): ReservationRequestBuilder;
17
+ }
18
+ export declare function createClient(requestAdapter: RequestAdapter): Client;
19
+ export declare const ClientUriTemplate = "{+baseurl}";
20
+ export declare const ClientNavigationMetadata: Record<Exclude<keyof Client, KeysToExcludeForNavigationMetadata>, NavigationMetadata>;
@@ -1,106 +1,43 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- // Generated by Microsoft Kiota
4
- // @ts-ignore
5
- import { OrderRequestBuilderNavigationMetadata, OrderRequestBuilderRequestsMetadata, type OrderRequestBuilder } from './order/index.js';
6
- // @ts-ignore
7
- import { PartnerRequestBuilderRequestsMetadata, type PartnerRequestBuilder } from './partner/index.js';
8
- // @ts-ignore
9
- import { PriceListRequestBuilderRequestsMetadata, type PriceListRequestBuilder } from './priceList/index.js';
10
- // @ts-ignore
11
- import { ProductRequestBuilderNavigationMetadata, ProductRequestBuilderRequestsMetadata, type ProductRequestBuilder } from './product/index.js';
12
- // @ts-ignore
13
- import { PublisherRequestBuilderRequestsMetadata, type PublisherRequestBuilder } from './publisher/index.js';
14
- // @ts-ignore
15
- import { RegionRequestBuilderRequestsMetadata, type RegionRequestBuilder } from './region/index.js';
16
- // @ts-ignore
17
- import { ReservationRequestBuilderNavigationMetadata, ReservationRequestBuilderRequestsMetadata, type ReservationRequestBuilder } from './reservation/index.js';
18
- // @ts-ignore
19
- import { apiClientProxifier, ParseNodeFactoryRegistry, SerializationWriterFactoryRegistry, type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type RequestAdapter } from '@microsoft/kiota-abstractions';
20
- // @ts-ignore
1
+ import { OrderRequestBuilderNavigationMetadata, OrderRequestBuilderRequestsMetadata } from './order/index.js';
2
+ import { PartnerRequestBuilderRequestsMetadata } from './partner/index.js';
3
+ import { PriceListRequestBuilderRequestsMetadata } from './priceList/index.js';
4
+ import { ProductRequestBuilderNavigationMetadata, ProductRequestBuilderRequestsMetadata } from './product/index.js';
5
+ import { PublisherRequestBuilderRequestsMetadata } from './publisher/index.js';
6
+ import { RegionRequestBuilderRequestsMetadata } from './region/index.js';
7
+ import { ReservationRequestBuilderNavigationMetadata, ReservationRequestBuilderRequestsMetadata } from './reservation/index.js';
8
+ import { apiClientProxifier } from '@microsoft/kiota-abstractions';
21
9
  import { FormParseNodeFactory, FormSerializationWriterFactory } from '@microsoft/kiota-serialization-form';
22
- // @ts-ignore
23
10
  import { JsonParseNodeFactory, JsonSerializationWriterFactory } from '@microsoft/kiota-serialization-json';
24
- // @ts-ignore
25
11
  import { MultipartSerializationWriterFactory } from '@microsoft/kiota-serialization-multipart';
26
- // @ts-ignore
27
12
  import { TextParseNodeFactory, TextSerializationWriterFactory } from '@microsoft/kiota-serialization-text';
28
-
29
- /**
30
- * The main entry point of the SDK, exposes the configuration and the fluent API.
31
- */
32
- export interface Client extends BaseRequestBuilder<Client> {
33
- /**
34
- * The Order property
35
- */
36
- get order(): OrderRequestBuilder;
37
- /**
38
- * The Partner property
39
- */
40
- get partner(): PartnerRequestBuilder;
41
- /**
42
- * The PriceList property
43
- */
44
- get priceList(): PriceListRequestBuilder;
45
- /**
46
- * The Product property
47
- */
48
- get product(): ProductRequestBuilder;
49
- /**
50
- * The Publisher property
51
- */
52
- get publisher(): PublisherRequestBuilder;
53
- /**
54
- * The Region property
55
- */
56
- get region(): RegionRequestBuilder;
57
- /**
58
- * The Reservation property
59
- */
60
- get reservation(): ReservationRequestBuilder;
61
- }
62
- /**
63
- * Instantiates a new {@link Client} and sets the default values.
64
- * @param requestAdapter The request adapter to use to execute the requests.
65
- */
66
- // @ts-ignore
67
- export function createClient(requestAdapter: RequestAdapter) {
13
+ export function createClient(requestAdapter) {
68
14
  if (requestAdapter === undefined) {
69
15
  throw new Error("requestAdapter cannot be undefined");
70
16
  }
71
- const serializationWriterFactory = requestAdapter.getSerializationWriterFactory() as SerializationWriterFactoryRegistry;
72
- const parseNodeFactoryRegistry = requestAdapter.getParseNodeFactory() as ParseNodeFactoryRegistry;
17
+ const serializationWriterFactory = requestAdapter.getSerializationWriterFactory();
18
+ const parseNodeFactoryRegistry = requestAdapter.getParseNodeFactory();
73
19
  const backingStoreFactory = requestAdapter.getBackingStoreFactory();
74
-
75
20
  if (parseNodeFactoryRegistry.registerDefaultDeserializer) {
76
21
  parseNodeFactoryRegistry.registerDefaultDeserializer(JsonParseNodeFactory, backingStoreFactory);
77
22
  parseNodeFactoryRegistry.registerDefaultDeserializer(TextParseNodeFactory, backingStoreFactory);
78
23
  parseNodeFactoryRegistry.registerDefaultDeserializer(FormParseNodeFactory, backingStoreFactory);
79
24
  }
80
-
81
25
  if (serializationWriterFactory.registerDefaultSerializer) {
82
26
  serializationWriterFactory.registerDefaultSerializer(JsonSerializationWriterFactory);
83
27
  serializationWriterFactory.registerDefaultSerializer(TextSerializationWriterFactory);
84
28
  serializationWriterFactory.registerDefaultSerializer(FormSerializationWriterFactory);
85
29
  serializationWriterFactory.registerDefaultSerializer(MultipartSerializationWriterFactory);
86
30
  }
87
-
88
31
  if (requestAdapter.baseUrl === undefined || requestAdapter.baseUrl === null || requestAdapter.baseUrl === "") {
89
32
  requestAdapter.baseUrl = "https://api.missioncontrol.io/partnerApi/v2";
90
33
  }
91
- const pathParameters: Record<string, unknown> = {
34
+ const pathParameters = {
92
35
  "baseurl": requestAdapter.baseUrl,
93
36
  };
94
- return apiClientProxifier<Client>(requestAdapter, pathParameters, ClientNavigationMetadata, undefined);
37
+ return apiClientProxifier(requestAdapter, pathParameters, ClientNavigationMetadata, undefined);
95
38
  }
96
- /**
97
- * Uri template for the request builder.
98
- */
99
39
  export const ClientUriTemplate = "{+baseurl}";
100
- /**
101
- * Metadata for all the navigation properties in the request builder.
102
- */
103
- export const ClientNavigationMetadata: Record<Exclude<keyof Client, KeysToExcludeForNavigationMetadata>, NavigationMetadata> = {
40
+ export const ClientNavigationMetadata = {
104
41
  order: {
105
42
  requestsMetadata: OrderRequestBuilderRequestsMetadata,
106
43
  navigationMetadata: OrderRequestBuilderNavigationMetadata,
@@ -126,5 +63,3 @@ export const ClientNavigationMetadata: Record<Exclude<keyof Client, KeysToExclud
126
63
  navigationMetadata: ReservationRequestBuilderNavigationMetadata,
127
64
  },
128
65
  };
129
- /* tslint:enable */
130
- /* eslint-enable */
@@ -0,0 +1,277 @@
1
+ import { type AdditionalDataHolder, type ApiError, type Guid, type Parsable, type ParseNode, type SerializationWriter } from '@microsoft/kiota-abstractions';
2
+ export interface ArchivingInfo extends Parsable {
3
+ archivedOnUtc?: Date | null;
4
+ isArchived?: boolean | null;
5
+ }
6
+ export interface Browser extends Parsable {
7
+ acceptLanguage?: string | null;
8
+ userAgent?: string | null;
9
+ }
10
+ export interface CancelOrderRequest extends Parsable {
11
+ originalRequestId?: Guid | null;
12
+ }
13
+ export interface ClaimReservationRequest extends Parsable {
14
+ endConsumer?: Consumer | null;
15
+ invoiceDate?: Date | null;
16
+ partnerReference?: string | null;
17
+ requestId?: Guid | null;
18
+ salesChannel?: Guid[] | null;
19
+ salesPrice?: SalesPriceRequest | null;
20
+ }
21
+ export interface Consumer extends Parsable {
22
+ browser?: Browser | null;
23
+ ipAddress?: string | null;
24
+ language?: string | null;
25
+ location?: Location | null;
26
+ }
27
+ export declare function createArchivingInfoFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
28
+ export declare function createBrowserFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
29
+ export declare function createCancelOrderRequestFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
30
+ export declare function createClaimReservationRequestFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
31
+ export declare function createConsumerFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
32
+ export declare function createCreateOrderRequestFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
33
+ export declare function createCreateReservationRequestFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
34
+ export declare function createDeductionFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
35
+ export declare function createHasStockRequestFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
36
+ export declare function createHasStockResponseFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
37
+ export declare function createKeyFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
38
+ export declare function createLocationFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
39
+ export declare function createMoneyFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
40
+ export declare function createOrderFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
41
+ export declare function createOrderListResultFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
42
+ export interface CreateOrderRequest extends Parsable {
43
+ countryCode?: string | null;
44
+ endConsumer?: Consumer | null;
45
+ invoiceDate?: Date | null;
46
+ partnerReference?: string | null;
47
+ productId?: Guid | null;
48
+ regionId?: Guid | null;
49
+ requestId?: Guid | null;
50
+ salesChannel?: Guid[] | null;
51
+ salesPrice?: SalesPriceRequest | null;
52
+ }
53
+ export declare function createPartnerFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
54
+ export declare function createPartnerListResultFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
55
+ export declare function createPriceListFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
56
+ export declare function createPriceListItemFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
57
+ export declare function createProblemDetailsFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
58
+ export declare function createProductFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
59
+ export declare function createProductListResultFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
60
+ export declare function createPublisherFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
61
+ export declare function createPublisherListResultFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
62
+ export declare function createRedemptionInstructionFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
63
+ export declare function createRegionFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
64
+ export declare function createRegionListResultFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
65
+ export declare function createReportOrderRequestFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
66
+ export declare function createReservationFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
67
+ export interface CreateReservationRequest extends Parsable {
68
+ countryCode?: string | null;
69
+ productId?: Guid | null;
70
+ regionId?: Guid | null;
71
+ }
72
+ export declare function createSalesPriceRequestFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
73
+ export declare function createVatDetailFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
74
+ export interface Deduction extends Parsable {
75
+ amount?: Money | null;
76
+ name?: string | null;
77
+ type?: number | null;
78
+ }
79
+ export declare function deserializeIntoArchivingInfo(archivingInfo?: Partial<ArchivingInfo> | undefined): Record<string, (node: ParseNode) => void>;
80
+ export declare function deserializeIntoBrowser(browser?: Partial<Browser> | undefined): Record<string, (node: ParseNode) => void>;
81
+ export declare function deserializeIntoCancelOrderRequest(cancelOrderRequest?: Partial<CancelOrderRequest> | undefined): Record<string, (node: ParseNode) => void>;
82
+ export declare function deserializeIntoClaimReservationRequest(claimReservationRequest?: Partial<ClaimReservationRequest> | undefined): Record<string, (node: ParseNode) => void>;
83
+ export declare function deserializeIntoConsumer(consumer?: Partial<Consumer> | undefined): Record<string, (node: ParseNode) => void>;
84
+ export declare function deserializeIntoCreateOrderRequest(createOrderRequest?: Partial<CreateOrderRequest> | undefined): Record<string, (node: ParseNode) => void>;
85
+ export declare function deserializeIntoCreateReservationRequest(createReservationRequest?: Partial<CreateReservationRequest> | undefined): Record<string, (node: ParseNode) => void>;
86
+ export declare function deserializeIntoDeduction(deduction?: Partial<Deduction> | undefined): Record<string, (node: ParseNode) => void>;
87
+ export declare function deserializeIntoHasStockRequest(hasStockRequest?: Partial<HasStockRequest> | undefined): Record<string, (node: ParseNode) => void>;
88
+ export declare function deserializeIntoHasStockResponse(hasStockResponse?: Partial<HasStockResponse> | undefined): Record<string, (node: ParseNode) => void>;
89
+ export declare function deserializeIntoKey(key?: Partial<Key> | undefined): Record<string, (node: ParseNode) => void>;
90
+ export declare function deserializeIntoLocation(location?: Partial<Location> | undefined): Record<string, (node: ParseNode) => void>;
91
+ export declare function deserializeIntoMoney(money?: Partial<Money> | undefined): Record<string, (node: ParseNode) => void>;
92
+ export declare function deserializeIntoOrder(order?: Partial<Order> | undefined): Record<string, (node: ParseNode) => void>;
93
+ export declare function deserializeIntoOrderListResult(orderListResult?: Partial<OrderListResult> | undefined): Record<string, (node: ParseNode) => void>;
94
+ export declare function deserializeIntoPartner(partner?: Partial<Partner> | undefined): Record<string, (node: ParseNode) => void>;
95
+ export declare function deserializeIntoPartnerListResult(partnerListResult?: Partial<PartnerListResult> | undefined): Record<string, (node: ParseNode) => void>;
96
+ export declare function deserializeIntoPriceList(priceList?: Partial<PriceList> | undefined): Record<string, (node: ParseNode) => void>;
97
+ export declare function deserializeIntoPriceListItem(priceListItem?: Partial<PriceListItem> | undefined): Record<string, (node: ParseNode) => void>;
98
+ export declare function deserializeIntoProblemDetails(problemDetails?: Partial<ProblemDetails> | undefined): Record<string, (node: ParseNode) => void>;
99
+ export declare function deserializeIntoProduct(product?: Partial<Product> | undefined): Record<string, (node: ParseNode) => void>;
100
+ export declare function deserializeIntoProductListResult(productListResult?: Partial<ProductListResult> | undefined): Record<string, (node: ParseNode) => void>;
101
+ export declare function deserializeIntoPublisher(publisher?: Partial<Publisher> | undefined): Record<string, (node: ParseNode) => void>;
102
+ export declare function deserializeIntoPublisherListResult(publisherListResult?: Partial<PublisherListResult> | undefined): Record<string, (node: ParseNode) => void>;
103
+ export declare function deserializeIntoRedemptionInstruction(redemptionInstruction?: Partial<RedemptionInstruction> | undefined): Record<string, (node: ParseNode) => void>;
104
+ export declare function deserializeIntoRegion(region?: Partial<Region> | undefined): Record<string, (node: ParseNode) => void>;
105
+ export declare function deserializeIntoRegionListResult(regionListResult?: Partial<RegionListResult> | undefined): Record<string, (node: ParseNode) => void>;
106
+ export declare function deserializeIntoReportOrderRequest(reportOrderRequest?: Partial<ReportOrderRequest> | undefined): Record<string, (node: ParseNode) => void>;
107
+ export declare function deserializeIntoReservation(reservation?: Partial<Reservation> | undefined): Record<string, (node: ParseNode) => void>;
108
+ export declare function deserializeIntoSalesPriceRequest(salesPriceRequest?: Partial<SalesPriceRequest> | undefined): Record<string, (node: ParseNode) => void>;
109
+ export declare function deserializeIntoVatDetail(vatDetail?: Partial<VatDetail> | undefined): Record<string, (node: ParseNode) => void>;
110
+ export interface HasStockRequest extends Parsable {
111
+ countryCode?: string | null;
112
+ productId?: Guid | null;
113
+ regionId?: Guid | null;
114
+ }
115
+ export interface HasStockResponse extends Parsable {
116
+ hasStock?: boolean | null;
117
+ }
118
+ export interface Key extends Parsable {
119
+ reference?: string | null;
120
+ value?: string | null;
121
+ }
122
+ export interface Location extends Parsable {
123
+ city?: string | null;
124
+ countryCode?: string | null;
125
+ region?: string | null;
126
+ }
127
+ export interface Money extends Parsable {
128
+ currencyCode?: string | null;
129
+ value?: number | null;
130
+ }
131
+ export interface Order extends Parsable {
132
+ created?: Date | null;
133
+ id?: Guid | null;
134
+ key?: Key | null;
135
+ msrp?: Money | null;
136
+ partnerId?: Guid | null;
137
+ partnerReference?: string | null;
138
+ productId?: Guid | null;
139
+ productName?: string | null;
140
+ publisherId?: Guid | null;
141
+ redemptionInstruction?: RedemptionInstruction | null;
142
+ regionId?: Guid | null;
143
+ regionName?: string | null;
144
+ requestId?: Guid | null;
145
+ statusId?: number | null;
146
+ statusText?: string | null;
147
+ }
148
+ export interface OrderListResult extends Parsable {
149
+ pageCount?: number | null;
150
+ result?: Order[] | null;
151
+ totalCount?: number | null;
152
+ }
153
+ export interface Partner extends Parsable {
154
+ hubSpotUrl?: string | null;
155
+ id?: Guid | null;
156
+ name?: string | null;
157
+ }
158
+ export interface PartnerListResult extends Parsable {
159
+ pageCount?: number | null;
160
+ result?: Partner[] | null;
161
+ totalCount?: number | null;
162
+ }
163
+ export interface PriceList extends Parsable {
164
+ prices?: PriceListItem[] | null;
165
+ productId?: Guid | null;
166
+ }
167
+ export interface PriceListItem extends Parsable {
168
+ countryCode?: string | null;
169
+ msrp?: Money | null;
170
+ }
171
+ export interface ProblemDetails extends AdditionalDataHolder, ApiError, Parsable {
172
+ detail?: string | null;
173
+ instance?: string | null;
174
+ status?: number | null;
175
+ title?: string | null;
176
+ type?: string | null;
177
+ }
178
+ export interface Product extends Parsable {
179
+ allowedRegions?: Guid[] | null;
180
+ canBeReserved?: boolean | null;
181
+ id?: Guid | null;
182
+ msrp?: Money | null;
183
+ name?: string | null;
184
+ platformId?: number | null;
185
+ platformName?: string | null;
186
+ productTypeDescription?: string | null;
187
+ productTypeId?: number | null;
188
+ publisherId?: Guid | null;
189
+ releaseDate?: Date | null;
190
+ }
191
+ export interface ProductListResult extends Parsable {
192
+ pageCount?: number | null;
193
+ result?: Product[] | null;
194
+ totalCount?: number | null;
195
+ }
196
+ export interface Publisher extends Parsable {
197
+ id?: Guid | null;
198
+ imageUrl?: string | null;
199
+ name?: string | null;
200
+ }
201
+ export interface PublisherListResult extends Parsable {
202
+ pageCount?: number | null;
203
+ result?: Publisher[] | null;
204
+ totalCount?: number | null;
205
+ }
206
+ export interface RedemptionInstruction extends Parsable {
207
+ languageCode?: string | null;
208
+ text?: string | null;
209
+ }
210
+ export interface Region extends Parsable {
211
+ archiveInfo?: ArchivingInfo | null;
212
+ countries?: string[] | null;
213
+ id?: Guid | null;
214
+ name?: string | null;
215
+ }
216
+ export interface RegionListResult extends Parsable {
217
+ pageCount?: number | null;
218
+ result?: Region[] | null;
219
+ totalCount?: number | null;
220
+ }
221
+ export interface ReportOrderRequest extends Parsable {
222
+ endConsumer?: Consumer | null;
223
+ invoiceDate?: Date | null;
224
+ partnerReference?: string | null;
225
+ productId?: Guid | null;
226
+ regionId?: Guid | null;
227
+ requestId?: Guid | null;
228
+ salesChannel?: Guid[] | null;
229
+ salesPrice?: SalesPriceRequest | null;
230
+ }
231
+ export interface Reservation extends Parsable {
232
+ expires?: Date | null;
233
+ id?: Guid | null;
234
+ statusDescription?: string | null;
235
+ statusId?: number | null;
236
+ }
237
+ export interface SalesPriceRequest extends Parsable {
238
+ deductions?: Deduction[] | null;
239
+ priceIncludingVat?: Money | null;
240
+ vatDetail?: VatDetail | null;
241
+ }
242
+ export declare function serializeArchivingInfo(writer: SerializationWriter, archivingInfo?: Partial<ArchivingInfo> | undefined | null, isSerializingDerivedType?: boolean): void;
243
+ export declare function serializeBrowser(writer: SerializationWriter, browser?: Partial<Browser> | undefined | null, isSerializingDerivedType?: boolean): void;
244
+ export declare function serializeCancelOrderRequest(writer: SerializationWriter, cancelOrderRequest?: Partial<CancelOrderRequest> | undefined | null, isSerializingDerivedType?: boolean): void;
245
+ export declare function serializeClaimReservationRequest(writer: SerializationWriter, claimReservationRequest?: Partial<ClaimReservationRequest> | undefined | null, isSerializingDerivedType?: boolean): void;
246
+ export declare function serializeConsumer(writer: SerializationWriter, consumer?: Partial<Consumer> | undefined | null, isSerializingDerivedType?: boolean): void;
247
+ export declare function serializeCreateOrderRequest(writer: SerializationWriter, createOrderRequest?: Partial<CreateOrderRequest> | undefined | null, isSerializingDerivedType?: boolean): void;
248
+ export declare function serializeCreateReservationRequest(writer: SerializationWriter, createReservationRequest?: Partial<CreateReservationRequest> | undefined | null, isSerializingDerivedType?: boolean): void;
249
+ export declare function serializeDeduction(writer: SerializationWriter, deduction?: Partial<Deduction> | undefined | null, isSerializingDerivedType?: boolean): void;
250
+ export declare function serializeHasStockRequest(writer: SerializationWriter, hasStockRequest?: Partial<HasStockRequest> | undefined | null, isSerializingDerivedType?: boolean): void;
251
+ export declare function serializeHasStockResponse(writer: SerializationWriter, hasStockResponse?: Partial<HasStockResponse> | undefined | null, isSerializingDerivedType?: boolean): void;
252
+ export declare function serializeKey(writer: SerializationWriter, key?: Partial<Key> | undefined | null, isSerializingDerivedType?: boolean): void;
253
+ export declare function serializeLocation(writer: SerializationWriter, location?: Partial<Location> | undefined | null, isSerializingDerivedType?: boolean): void;
254
+ export declare function serializeMoney(writer: SerializationWriter, money?: Partial<Money> | undefined | null, isSerializingDerivedType?: boolean): void;
255
+ export declare function serializeOrder(writer: SerializationWriter, order?: Partial<Order> | undefined | null, isSerializingDerivedType?: boolean): void;
256
+ export declare function serializeOrderListResult(writer: SerializationWriter, orderListResult?: Partial<OrderListResult> | undefined | null, isSerializingDerivedType?: boolean): void;
257
+ export declare function serializePartner(writer: SerializationWriter, partner?: Partial<Partner> | undefined | null, isSerializingDerivedType?: boolean): void;
258
+ export declare function serializePartnerListResult(writer: SerializationWriter, partnerListResult?: Partial<PartnerListResult> | undefined | null, isSerializingDerivedType?: boolean): void;
259
+ export declare function serializePriceList(writer: SerializationWriter, priceList?: Partial<PriceList> | undefined | null, isSerializingDerivedType?: boolean): void;
260
+ export declare function serializePriceListItem(writer: SerializationWriter, priceListItem?: Partial<PriceListItem> | undefined | null, isSerializingDerivedType?: boolean): void;
261
+ export declare function serializeProblemDetails(writer: SerializationWriter, problemDetails?: Partial<ProblemDetails> | undefined | null, isSerializingDerivedType?: boolean): void;
262
+ export declare function serializeProduct(writer: SerializationWriter, product?: Partial<Product> | undefined | null, isSerializingDerivedType?: boolean): void;
263
+ export declare function serializeProductListResult(writer: SerializationWriter, productListResult?: Partial<ProductListResult> | undefined | null, isSerializingDerivedType?: boolean): void;
264
+ export declare function serializePublisher(writer: SerializationWriter, publisher?: Partial<Publisher> | undefined | null, isSerializingDerivedType?: boolean): void;
265
+ export declare function serializePublisherListResult(writer: SerializationWriter, publisherListResult?: Partial<PublisherListResult> | undefined | null, isSerializingDerivedType?: boolean): void;
266
+ export declare function serializeRedemptionInstruction(writer: SerializationWriter, redemptionInstruction?: Partial<RedemptionInstruction> | undefined | null, isSerializingDerivedType?: boolean): void;
267
+ export declare function serializeRegion(writer: SerializationWriter, region?: Partial<Region> | undefined | null, isSerializingDerivedType?: boolean): void;
268
+ export declare function serializeRegionListResult(writer: SerializationWriter, regionListResult?: Partial<RegionListResult> | undefined | null, isSerializingDerivedType?: boolean): void;
269
+ export declare function serializeReportOrderRequest(writer: SerializationWriter, reportOrderRequest?: Partial<ReportOrderRequest> | undefined | null, isSerializingDerivedType?: boolean): void;
270
+ export declare function serializeReservation(writer: SerializationWriter, reservation?: Partial<Reservation> | undefined | null, isSerializingDerivedType?: boolean): void;
271
+ export declare function serializeSalesPriceRequest(writer: SerializationWriter, salesPriceRequest?: Partial<SalesPriceRequest> | undefined | null, isSerializingDerivedType?: boolean): void;
272
+ export declare function serializeVatDetail(writer: SerializationWriter, vatDetail?: Partial<VatDetail> | undefined | null, isSerializingDerivedType?: boolean): void;
273
+ export interface VatDetail extends Parsable {
274
+ amount?: Money | null;
275
+ priceExcludingVat?: Money | null;
276
+ rate?: number | null;
277
+ }