@missioncontrolio/client 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/client/clientBuilder.d.ts +7 -1
- package/dist/client/clientBuilder.js +20 -3
- package/dist/client/generated/models/index.d.ts +5 -0
- package/dist/client/generated/models/index.js +40 -0
- package/dist/client/generated/product/index.d.ts +2 -0
- package/dist/client/generated/product/index.js +5 -0
- package/dist/client/generated/product/item/index.d.ts +7 -0
- package/dist/client/generated/product/item/index.js +7 -0
- package/dist/client/generated/product/item/redemptionInstructions/index.d.ts +8 -0
- package/dist/client/generated/product/item/redemptionInstructions/index.js +15 -0
- package/dist/client/generatedAssets/assetPack/index.d.ts +7 -0
- package/dist/client/generatedAssets/assetPack/index.js +8 -0
- package/dist/client/generatedAssets/assetPack/item/index.d.ts +7 -0
- package/dist/client/generatedAssets/assetPack/item/index.js +9 -0
- package/dist/client/generatedAssets/assetPack/item/item/index.d.ts +11 -0
- package/dist/client/generatedAssets/assetPack/item/item/index.js +21 -0
- package/dist/client/generatedAssets/assetPack/item/item/item/index.d.ts +8 -0
- package/dist/client/generatedAssets/assetPack/item/item/item/index.js +14 -0
- package/dist/client/generatedAssets/assetsClient.d.ts +8 -0
- package/dist/client/generatedAssets/assetsClient.js +38 -0
- package/dist/client/generatedAssets/models/index.d.ts +54 -0
- package/dist/client/generatedAssets/models/index.js +117 -0
- package/dist/client/missionControlEnvironment.d.ts +1 -0
- package/dist/client/missionControlEnvironment.js +5 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,6 +65,18 @@ const response = await client.product.hasStock.post({
|
|
|
65
65
|
console.log(response?.hasStock ? "In stock" : "Out of stock");
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
+
### Get redemption instructions
|
|
69
|
+
|
|
70
|
+
Retrieve a product's redemption instructions (one entry per language) before placing an order.
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
const instructions = await client.product.byProductId(productId).redemptionInstructions.get();
|
|
74
|
+
|
|
75
|
+
for (const instruction of instructions ?? []) {
|
|
76
|
+
console.log(`${instruction.languageCode}: ${instruction.text}`);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
68
80
|
### Reserve → claim (place an order)
|
|
69
81
|
|
|
70
82
|
```ts
|
|
@@ -102,6 +114,24 @@ console.log(`Order ${order!.id} placed.`);
|
|
|
102
114
|
await client.reservation.byReservationId(reservation!.id!).cancel.post();
|
|
103
115
|
```
|
|
104
116
|
|
|
117
|
+
### Get asset packs
|
|
118
|
+
|
|
119
|
+
Asset packs hold the images, logos and other marketing assets publishers provide for a product. They are served by the Assets API, available on `client.assets`.
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
const product = client.assets.assetPack.byPublisherId(publisherId).byProductId(productId);
|
|
123
|
+
const packs = await product.get();
|
|
124
|
+
|
|
125
|
+
for (const pack of packs?.result ?? []) {
|
|
126
|
+
// Fetch a pack to get its assets.
|
|
127
|
+
const detail = await product.byAssetPackId(pack.id!).get();
|
|
128
|
+
|
|
129
|
+
for (const asset of detail?.assets ?? []) {
|
|
130
|
+
console.log(`${asset.fileName} ${asset.url}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
105
135
|
### Filtering and pagination
|
|
106
136
|
|
|
107
137
|
All list endpoints accept an optional `queryParameters` object for filtering and pagination. Every parameter is optional — only set what you need.
|
|
@@ -137,6 +167,7 @@ const result = await client.product.get({
|
|
|
137
167
|
| `withDefaultPartnerId(partnerId)` | Set the `X-Partner-Id` header for every request |
|
|
138
168
|
| `forEnvironment(env)` | Target `Sandbox` or `Production` |
|
|
139
169
|
| `withBaseUrl(url)` | Override the base URL (e.g. for local development) |
|
|
170
|
+
| `withAssetsBaseUrl(url)` | Override the base URL of the Assets API |
|
|
140
171
|
| `withScope(scope)` | Override the OAuth scope |
|
|
141
172
|
| `build()` | Return the configured `Client` instance |
|
|
142
173
|
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { MissionControlEnvironment } from "./missionControlEnvironment.js";
|
|
2
2
|
import { type Client } from "./generated/client.js";
|
|
3
|
+
import { type AssetsClient } from "./generatedAssets/assetsClient.js";
|
|
4
|
+
export type MissionControlClient = Client & {
|
|
5
|
+
readonly assets: AssetsClient;
|
|
6
|
+
};
|
|
3
7
|
export declare class ClientBuilder {
|
|
4
8
|
private _baseUrl;
|
|
9
|
+
private _assetsBaseUrl;
|
|
5
10
|
private _scope;
|
|
6
11
|
private _tenantId;
|
|
7
12
|
private _clientId?;
|
|
@@ -9,8 +14,9 @@ export declare class ClientBuilder {
|
|
|
9
14
|
private _defaultPartnerId?;
|
|
10
15
|
withDefaultPartnerId(partnerId: string): this;
|
|
11
16
|
withBaseUrl(baseUrl: string): this;
|
|
17
|
+
withAssetsBaseUrl(assetsBaseUrl: string): this;
|
|
12
18
|
withScope(scope: string): this;
|
|
13
19
|
forEnvironment(environment: MissionControlEnvironment): this;
|
|
14
20
|
withAzureAdClientCredentials(clientId: string, clientSecret: string, tenantId?: string): this;
|
|
15
|
-
build():
|
|
21
|
+
build(): MissionControlClient;
|
|
16
22
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ClientSecretCredential } from "@azure/identity";
|
|
2
2
|
import { AzureIdentityAuthenticationProvider } from "@microsoft/kiota-authentication-azure";
|
|
3
3
|
import { FetchRequestAdapter, KiotaClientFactory, } from "@microsoft/kiota-http-fetchlibrary";
|
|
4
|
-
import { getBaseUrl, getScope, MissionControlEnvironment, } from "./missionControlEnvironment.js";
|
|
4
|
+
import { getAssetsBaseUrl, getBaseUrl, getScope, MissionControlEnvironment, } from "./missionControlEnvironment.js";
|
|
5
5
|
import { createClient } from "./generated/client.js";
|
|
6
|
+
import { createAssetsClient } from "./generatedAssets/assetsClient.js";
|
|
6
7
|
import { createHandlers } from "./missionControlHandlers.js";
|
|
7
8
|
export class ClientBuilder {
|
|
8
9
|
constructor() {
|
|
9
10
|
this._baseUrl = getBaseUrl(MissionControlEnvironment.Production);
|
|
11
|
+
this._assetsBaseUrl = getAssetsBaseUrl(MissionControlEnvironment.Production);
|
|
10
12
|
this._scope = getScope(MissionControlEnvironment.Production);
|
|
11
13
|
this._tenantId = "13d084c1-d072-41f2-878b-c45ca721c9f6";
|
|
12
14
|
}
|
|
@@ -22,6 +24,12 @@ export class ClientBuilder {
|
|
|
22
24
|
this._baseUrl = baseUrl;
|
|
23
25
|
return this;
|
|
24
26
|
}
|
|
27
|
+
withAssetsBaseUrl(assetsBaseUrl) {
|
|
28
|
+
if (!assetsBaseUrl?.trim())
|
|
29
|
+
throw new Error("assetsBaseUrl must not be null or whitespace.");
|
|
30
|
+
this._assetsBaseUrl = assetsBaseUrl;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
25
33
|
withScope(scope) {
|
|
26
34
|
if (!scope?.trim())
|
|
27
35
|
throw new Error("scope must not be null or whitespace.");
|
|
@@ -30,6 +38,7 @@ export class ClientBuilder {
|
|
|
30
38
|
}
|
|
31
39
|
forEnvironment(environment) {
|
|
32
40
|
this._baseUrl = getBaseUrl(environment);
|
|
41
|
+
this._assetsBaseUrl = getAssetsBaseUrl(environment);
|
|
33
42
|
this._scope = getScope(environment);
|
|
34
43
|
return this;
|
|
35
44
|
}
|
|
@@ -46,12 +55,20 @@ export class ClientBuilder {
|
|
|
46
55
|
"Call withAzureAdClientCredentials() before calling build().");
|
|
47
56
|
}
|
|
48
57
|
const credential = new ClientSecretCredential(this._tenantId, this._clientId, this._clientSecret);
|
|
49
|
-
const allowedHosts = new Set([
|
|
58
|
+
const allowedHosts = new Set([
|
|
59
|
+
new URL(this._baseUrl).host,
|
|
60
|
+
new URL(this._assetsBaseUrl).host,
|
|
61
|
+
]);
|
|
50
62
|
const authProvider = new AzureIdentityAuthenticationProvider(credential, [this._scope], undefined, allowedHosts);
|
|
51
63
|
const middlewares = createHandlers(this._defaultPartnerId);
|
|
52
64
|
const httpClient = KiotaClientFactory.create(undefined, middlewares);
|
|
53
65
|
const adapter = new FetchRequestAdapter(authProvider, undefined, undefined, httpClient);
|
|
54
66
|
adapter.baseUrl = this._baseUrl;
|
|
55
|
-
|
|
67
|
+
const assetsAdapter = new FetchRequestAdapter(authProvider, undefined, undefined, httpClient);
|
|
68
|
+
assetsAdapter.baseUrl = this._assetsBaseUrl;
|
|
69
|
+
const assets = createAssetsClient(assetsAdapter);
|
|
70
|
+
return new Proxy(createClient(adapter), {
|
|
71
|
+
get: (target, property, receiver) => property === "assets" ? assets : Reflect.get(target, property, receiver),
|
|
72
|
+
});
|
|
56
73
|
}
|
|
57
74
|
}
|
|
@@ -45,6 +45,7 @@ export interface CreateOrderRequest extends Parsable {
|
|
|
45
45
|
invoiceDate?: Date | null;
|
|
46
46
|
partnerReference?: string | null;
|
|
47
47
|
productId?: Guid | null;
|
|
48
|
+
productValue?: Money | null;
|
|
48
49
|
regionId?: Guid | null;
|
|
49
50
|
requestId?: Guid | null;
|
|
50
51
|
salesChannel?: Guid[] | null;
|
|
@@ -137,6 +138,7 @@ export interface Order extends Parsable {
|
|
|
137
138
|
partnerReference?: string | null;
|
|
138
139
|
productId?: Guid | null;
|
|
139
140
|
productName?: string | null;
|
|
141
|
+
productValue?: Money | null;
|
|
140
142
|
publisherId?: Guid | null;
|
|
141
143
|
redemptionInstruction?: RedemptionInstruction | null;
|
|
142
144
|
regionId?: Guid | null;
|
|
@@ -153,6 +155,7 @@ export interface OrderListResult extends Parsable {
|
|
|
153
155
|
export interface Partner extends Parsable {
|
|
154
156
|
hubSpotUrl?: string | null;
|
|
155
157
|
id?: Guid | null;
|
|
158
|
+
imageUrl?: string | null;
|
|
156
159
|
name?: string | null;
|
|
157
160
|
}
|
|
158
161
|
export interface PartnerListResult extends Parsable {
|
|
@@ -176,6 +179,7 @@ export interface ProblemDetails extends AdditionalDataHolder, ApiError, Parsable
|
|
|
176
179
|
type?: string | null;
|
|
177
180
|
}
|
|
178
181
|
export interface Product extends Parsable {
|
|
182
|
+
allowedCountries?: string[] | null;
|
|
179
183
|
allowedRegions?: Guid[] | null;
|
|
180
184
|
canBeReserved?: boolean | null;
|
|
181
185
|
id?: Guid | null;
|
|
@@ -187,6 +191,7 @@ export interface Product extends Parsable {
|
|
|
187
191
|
productTypeId?: number | null;
|
|
188
192
|
publisherId?: Guid | null;
|
|
189
193
|
releaseDate?: Date | null;
|
|
194
|
+
valueType?: number | null;
|
|
190
195
|
}
|
|
191
196
|
export interface ProductListResult extends Parsable {
|
|
192
197
|
pageCount?: number | null;
|
|
@@ -133,6 +133,7 @@ export function deserializeIntoCreateOrderRequest(createOrderRequest = {}) {
|
|
|
133
133
|
"invoiceDate": n => { createOrderRequest.invoiceDate = n.getDateValue(); },
|
|
134
134
|
"partnerReference": n => { createOrderRequest.partnerReference = n.getStringValue(); },
|
|
135
135
|
"productId": n => { createOrderRequest.productId = n.getGuidValue(); },
|
|
136
|
+
"productValue": n => { createOrderRequest.productValue = n.getObjectValue(createMoneyFromDiscriminatorValue); },
|
|
136
137
|
"regionId": n => { createOrderRequest.regionId = n.getGuidValue(); },
|
|
137
138
|
"requestId": n => { createOrderRequest.requestId = n.getGuidValue(); },
|
|
138
139
|
"salesChannel": n => { createOrderRequest.salesChannel = n.getCollectionOfPrimitiveValues("string"); },
|
|
@@ -194,6 +195,7 @@ export function deserializeIntoOrder(order = {}) {
|
|
|
194
195
|
"partnerReference": n => { order.partnerReference = n.getStringValue(); },
|
|
195
196
|
"productId": n => { order.productId = n.getGuidValue(); },
|
|
196
197
|
"productName": n => { order.productName = n.getStringValue(); },
|
|
198
|
+
"productValue": n => { order.productValue = n.getObjectValue(createMoneyFromDiscriminatorValue); },
|
|
197
199
|
"publisherId": n => { order.publisherId = n.getGuidValue(); },
|
|
198
200
|
"redemptionInstruction": n => { order.redemptionInstruction = n.getObjectValue(createRedemptionInstructionFromDiscriminatorValue); },
|
|
199
201
|
"regionId": n => { order.regionId = n.getGuidValue(); },
|
|
@@ -214,6 +216,7 @@ export function deserializeIntoPartner(partner = {}) {
|
|
|
214
216
|
return {
|
|
215
217
|
"hubSpotUrl": n => { partner.hubSpotUrl = n.getStringValue(); },
|
|
216
218
|
"id": n => { partner.id = n.getGuidValue(); },
|
|
219
|
+
"imageUrl": n => { partner.imageUrl = n.getStringValue(); },
|
|
217
220
|
"name": n => { partner.name = n.getStringValue(); },
|
|
218
221
|
};
|
|
219
222
|
}
|
|
@@ -247,6 +250,7 @@ export function deserializeIntoProblemDetails(problemDetails = {}) {
|
|
|
247
250
|
}
|
|
248
251
|
export function deserializeIntoProduct(product = {}) {
|
|
249
252
|
return {
|
|
253
|
+
"allowedCountries": n => { product.allowedCountries = n.getCollectionOfPrimitiveValues("string"); },
|
|
250
254
|
"allowedRegions": n => { product.allowedRegions = n.getCollectionOfPrimitiveValues("string"); },
|
|
251
255
|
"canBeReserved": n => { product.canBeReserved = n.getBooleanValue(); },
|
|
252
256
|
"id": n => { product.id = n.getGuidValue(); },
|
|
@@ -258,6 +262,7 @@ export function deserializeIntoProduct(product = {}) {
|
|
|
258
262
|
"productTypeId": n => { product.productTypeId = n.getNumberValue(); },
|
|
259
263
|
"publisherId": n => { product.publisherId = n.getGuidValue(); },
|
|
260
264
|
"releaseDate": n => { product.releaseDate = n.getDateValue(); },
|
|
265
|
+
"valueType": n => { product.valueType = n.getNumberValue(); },
|
|
261
266
|
};
|
|
262
267
|
}
|
|
263
268
|
export function deserializeIntoProductListResult(productListResult = {}) {
|
|
@@ -385,6 +390,7 @@ export function serializeCreateOrderRequest(writer, createOrderRequest = {}, isS
|
|
|
385
390
|
writer.writeDateValue("invoiceDate", createOrderRequest.invoiceDate);
|
|
386
391
|
writer.writeStringValue("partnerReference", createOrderRequest.partnerReference);
|
|
387
392
|
writer.writeGuidValue("productId", createOrderRequest.productId);
|
|
393
|
+
writer.writeObjectValue("productValue", createOrderRequest.productValue, serializeMoney);
|
|
388
394
|
writer.writeGuidValue("regionId", createOrderRequest.regionId);
|
|
389
395
|
writer.writeGuidValue("requestId", createOrderRequest.requestId);
|
|
390
396
|
writer.writeCollectionOfPrimitiveValues("salesChannel", createOrderRequest.salesChannel);
|
|
@@ -454,27 +460,39 @@ export function serializeOrder(writer, order = {}, isSerializingDerivedType = fa
|
|
|
454
460
|
writer.writeStringValue("partnerReference", order.partnerReference);
|
|
455
461
|
writer.writeGuidValue("productId", order.productId);
|
|
456
462
|
writer.writeStringValue("productName", order.productName);
|
|
463
|
+
writer.writeObjectValue("productValue", order.productValue, serializeMoney);
|
|
457
464
|
writer.writeGuidValue("publisherId", order.publisherId);
|
|
458
465
|
writer.writeObjectValue("redemptionInstruction", order.redemptionInstruction, serializeRedemptionInstruction);
|
|
459
466
|
writer.writeGuidValue("regionId", order.regionId);
|
|
460
467
|
writer.writeStringValue("regionName", order.regionName);
|
|
461
468
|
writer.writeGuidValue("requestId", order.requestId);
|
|
462
469
|
writer.writeNumberValue("statusId", order.statusId);
|
|
470
|
+
writer.writeStringValue("statusText", order.statusText);
|
|
463
471
|
}
|
|
464
472
|
export function serializeOrderListResult(writer, orderListResult = {}, isSerializingDerivedType = false) {
|
|
465
473
|
if (!orderListResult || isSerializingDerivedType) {
|
|
466
474
|
return;
|
|
467
475
|
}
|
|
476
|
+
writer.writeNumberValue("pageCount", orderListResult.pageCount);
|
|
477
|
+
writer.writeCollectionOfObjectValues("result", orderListResult.result, serializeOrder);
|
|
478
|
+
writer.writeNumberValue("totalCount", orderListResult.totalCount);
|
|
468
479
|
}
|
|
469
480
|
export function serializePartner(writer, partner = {}, isSerializingDerivedType = false) {
|
|
470
481
|
if (!partner || isSerializingDerivedType) {
|
|
471
482
|
return;
|
|
472
483
|
}
|
|
484
|
+
writer.writeStringValue("hubSpotUrl", partner.hubSpotUrl);
|
|
485
|
+
writer.writeGuidValue("id", partner.id);
|
|
486
|
+
writer.writeStringValue("imageUrl", partner.imageUrl);
|
|
487
|
+
writer.writeStringValue("name", partner.name);
|
|
473
488
|
}
|
|
474
489
|
export function serializePartnerListResult(writer, partnerListResult = {}, isSerializingDerivedType = false) {
|
|
475
490
|
if (!partnerListResult || isSerializingDerivedType) {
|
|
476
491
|
return;
|
|
477
492
|
}
|
|
493
|
+
writer.writeNumberValue("pageCount", partnerListResult.pageCount);
|
|
494
|
+
writer.writeCollectionOfObjectValues("result", partnerListResult.result, serializePartner);
|
|
495
|
+
writer.writeNumberValue("totalCount", partnerListResult.totalCount);
|
|
478
496
|
}
|
|
479
497
|
export function serializePriceList(writer, priceList = {}, isSerializingDerivedType = false) {
|
|
480
498
|
if (!priceList || isSerializingDerivedType) {
|
|
@@ -505,21 +523,33 @@ export function serializeProduct(writer, product = {}, isSerializingDerivedType
|
|
|
505
523
|
if (!product || isSerializingDerivedType) {
|
|
506
524
|
return;
|
|
507
525
|
}
|
|
526
|
+
writer.writeCollectionOfPrimitiveValues("allowedCountries", product.allowedCountries);
|
|
508
527
|
writer.writeCollectionOfPrimitiveValues("allowedRegions", product.allowedRegions);
|
|
509
528
|
writer.writeBooleanValue("canBeReserved", product.canBeReserved);
|
|
529
|
+
writer.writeGuidValue("id", product.id);
|
|
510
530
|
writer.writeObjectValue("msrp", product.msrp, serializeMoney);
|
|
531
|
+
writer.writeStringValue("name", product.name);
|
|
511
532
|
writer.writeNumberValue("platformId", product.platformId);
|
|
533
|
+
writer.writeStringValue("platformName", product.platformName);
|
|
534
|
+
writer.writeStringValue("productTypeDescription", product.productTypeDescription);
|
|
535
|
+
writer.writeNumberValue("productTypeId", product.productTypeId);
|
|
512
536
|
writer.writeGuidValue("publisherId", product.publisherId);
|
|
537
|
+
writer.writeDateValue("releaseDate", product.releaseDate);
|
|
538
|
+
writer.writeNumberValue("valueType", product.valueType);
|
|
513
539
|
}
|
|
514
540
|
export function serializeProductListResult(writer, productListResult = {}, isSerializingDerivedType = false) {
|
|
515
541
|
if (!productListResult || isSerializingDerivedType) {
|
|
516
542
|
return;
|
|
517
543
|
}
|
|
544
|
+
writer.writeNumberValue("pageCount", productListResult.pageCount);
|
|
545
|
+
writer.writeCollectionOfObjectValues("result", productListResult.result, serializeProduct);
|
|
546
|
+
writer.writeNumberValue("totalCount", productListResult.totalCount);
|
|
518
547
|
}
|
|
519
548
|
export function serializePublisher(writer, publisher = {}, isSerializingDerivedType = false) {
|
|
520
549
|
if (!publisher || isSerializingDerivedType) {
|
|
521
550
|
return;
|
|
522
551
|
}
|
|
552
|
+
writer.writeGuidValue("id", publisher.id);
|
|
523
553
|
writer.writeStringValue("imageUrl", publisher.imageUrl);
|
|
524
554
|
writer.writeStringValue("name", publisher.name);
|
|
525
555
|
}
|
|
@@ -527,6 +557,9 @@ export function serializePublisherListResult(writer, publisherListResult = {}, i
|
|
|
527
557
|
if (!publisherListResult || isSerializingDerivedType) {
|
|
528
558
|
return;
|
|
529
559
|
}
|
|
560
|
+
writer.writeNumberValue("pageCount", publisherListResult.pageCount);
|
|
561
|
+
writer.writeCollectionOfObjectValues("result", publisherListResult.result, serializePublisher);
|
|
562
|
+
writer.writeNumberValue("totalCount", publisherListResult.totalCount);
|
|
530
563
|
}
|
|
531
564
|
export function serializeRedemptionInstruction(writer, redemptionInstruction = {}, isSerializingDerivedType = false) {
|
|
532
565
|
if (!redemptionInstruction || isSerializingDerivedType) {
|
|
@@ -540,11 +573,17 @@ export function serializeRegion(writer, region = {}, isSerializingDerivedType =
|
|
|
540
573
|
return;
|
|
541
574
|
}
|
|
542
575
|
writer.writeObjectValue("archiveInfo", region.archiveInfo, serializeArchivingInfo);
|
|
576
|
+
writer.writeCollectionOfPrimitiveValues("countries", region.countries);
|
|
577
|
+
writer.writeGuidValue("id", region.id);
|
|
578
|
+
writer.writeStringValue("name", region.name);
|
|
543
579
|
}
|
|
544
580
|
export function serializeRegionListResult(writer, regionListResult = {}, isSerializingDerivedType = false) {
|
|
545
581
|
if (!regionListResult || isSerializingDerivedType) {
|
|
546
582
|
return;
|
|
547
583
|
}
|
|
584
|
+
writer.writeNumberValue("pageCount", regionListResult.pageCount);
|
|
585
|
+
writer.writeCollectionOfObjectValues("result", regionListResult.result, serializeRegion);
|
|
586
|
+
writer.writeNumberValue("totalCount", regionListResult.totalCount);
|
|
548
587
|
}
|
|
549
588
|
export function serializeReportOrderRequest(writer, reportOrderRequest = {}, isSerializingDerivedType = false) {
|
|
550
589
|
if (!reportOrderRequest || isSerializingDerivedType) {
|
|
@@ -565,6 +604,7 @@ export function serializeReservation(writer, reservation = {}, isSerializingDeri
|
|
|
565
604
|
}
|
|
566
605
|
writer.writeDateValue("expires", reservation.expires);
|
|
567
606
|
writer.writeGuidValue("id", reservation.id);
|
|
607
|
+
writer.writeStringValue("statusDescription", reservation.statusDescription);
|
|
568
608
|
writer.writeNumberValue("statusId", reservation.statusId);
|
|
569
609
|
}
|
|
570
610
|
export function serializeSalesPriceRequest(writer, salesPriceRequest = {}, isSerializingDerivedType = false) {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type ProductListResult } from '../models/index.js';
|
|
2
2
|
import { type HasStockRequestBuilder } from './hasStock/index.js';
|
|
3
|
+
import { type WithProductItemRequestBuilder } from './item/index.js';
|
|
3
4
|
import { type BaseRequestBuilder, type Guid, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
|
|
4
5
|
export type GetSortByQueryParameterType = (typeof GetSortByQueryParameterTypeObject)[keyof typeof GetSortByQueryParameterTypeObject];
|
|
5
6
|
export type GetSortDirectionQueryParameterType = (typeof GetSortDirectionQueryParameterTypeObject)[keyof typeof GetSortDirectionQueryParameterTypeObject];
|
|
6
7
|
export interface ProductRequestBuilder extends BaseRequestBuilder<ProductRequestBuilder> {
|
|
7
8
|
get hasStock(): HasStockRequestBuilder;
|
|
9
|
+
byProductId(productId: Guid): WithProductItemRequestBuilder;
|
|
8
10
|
get(requestConfiguration?: RequestConfiguration<ProductRequestBuilderGetQueryParameters> | undefined): Promise<ProductListResult | undefined>;
|
|
9
11
|
toGetRequestInformation(requestConfiguration?: RequestConfiguration<ProductRequestBuilderGetQueryParameters> | undefined): RequestInformation;
|
|
10
12
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createProblemDetailsFromDiscriminatorValue, createProductListResultFromDiscriminatorValue } from '../models/index.js';
|
|
2
2
|
import { HasStockRequestBuilderRequestsMetadata } from './hasStock/index.js';
|
|
3
|
+
import { WithProductItemRequestBuilderNavigationMetadata } from './item/index.js';
|
|
3
4
|
export const ProductRequestBuilderUriTemplate = "{+baseurl}/Product{?CountryCode*,IncludeMsrp*,Name*,ProductId*,PublisherId*,pageIndex*,pageSize*,sortBy*,sortDirection*}";
|
|
4
5
|
export const GetSortByQueryParameterTypeObject = {
|
|
5
6
|
Name: "name",
|
|
@@ -18,6 +19,10 @@ const ProductRequestBuilderGetQueryParametersMapper = {
|
|
|
18
19
|
"publisherId": "PublisherId",
|
|
19
20
|
};
|
|
20
21
|
export const ProductRequestBuilderNavigationMetadata = {
|
|
22
|
+
byProductId: {
|
|
23
|
+
navigationMetadata: WithProductItemRequestBuilderNavigationMetadata,
|
|
24
|
+
pathParametersMappings: ["productId"],
|
|
25
|
+
},
|
|
21
26
|
hasStock: {
|
|
22
27
|
requestsMetadata: HasStockRequestBuilderRequestsMetadata,
|
|
23
28
|
},
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RedemptionInstructionsRequestBuilder } from './redemptionInstructions/index.js';
|
|
2
|
+
import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata } from '@microsoft/kiota-abstractions';
|
|
3
|
+
export interface WithProductItemRequestBuilder extends BaseRequestBuilder<WithProductItemRequestBuilder> {
|
|
4
|
+
get redemptionInstructions(): RedemptionInstructionsRequestBuilder;
|
|
5
|
+
}
|
|
6
|
+
export declare const WithProductItemRequestBuilderUriTemplate = "{+baseurl}/Product/{productId}";
|
|
7
|
+
export declare const WithProductItemRequestBuilderNavigationMetadata: Record<Exclude<keyof WithProductItemRequestBuilder, KeysToExcludeForNavigationMetadata>, NavigationMetadata>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RedemptionInstructionsRequestBuilderRequestsMetadata } from './redemptionInstructions/index.js';
|
|
2
|
+
export const WithProductItemRequestBuilderUriTemplate = "{+baseurl}/Product/{productId}";
|
|
3
|
+
export const WithProductItemRequestBuilderNavigationMetadata = {
|
|
4
|
+
redemptionInstructions: {
|
|
5
|
+
requestsMetadata: RedemptionInstructionsRequestBuilderRequestsMetadata,
|
|
6
|
+
},
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RedemptionInstruction } from '../../../models/index.js';
|
|
2
|
+
import { type BaseRequestBuilder, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
|
|
3
|
+
export interface RedemptionInstructionsRequestBuilder extends BaseRequestBuilder<RedemptionInstructionsRequestBuilder> {
|
|
4
|
+
get(requestConfiguration?: RequestConfiguration<object> | undefined): Promise<RedemptionInstruction[] | undefined>;
|
|
5
|
+
toGetRequestInformation(requestConfiguration?: RequestConfiguration<object> | undefined): RequestInformation;
|
|
6
|
+
}
|
|
7
|
+
export declare const RedemptionInstructionsRequestBuilderUriTemplate = "{+baseurl}/Product/{productId}/redemptionInstructions";
|
|
8
|
+
export declare const RedemptionInstructionsRequestBuilderRequestsMetadata: RequestsMetadata;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createProblemDetailsFromDiscriminatorValue, createRedemptionInstructionFromDiscriminatorValue } from '../../../models/index.js';
|
|
2
|
+
export const RedemptionInstructionsRequestBuilderUriTemplate = "{+baseurl}/Product/{productId}/redemptionInstructions";
|
|
3
|
+
export const RedemptionInstructionsRequestBuilderRequestsMetadata = {
|
|
4
|
+
get: {
|
|
5
|
+
uriTemplate: RedemptionInstructionsRequestBuilderUriTemplate,
|
|
6
|
+
responseBodyContentType: "text/plain;q=0.9",
|
|
7
|
+
errorMappings: {
|
|
8
|
+
400: createProblemDetailsFromDiscriminatorValue,
|
|
9
|
+
404: createProblemDetailsFromDiscriminatorValue,
|
|
10
|
+
500: createProblemDetailsFromDiscriminatorValue,
|
|
11
|
+
},
|
|
12
|
+
adapterMethodName: "sendCollection",
|
|
13
|
+
responseBodyFactory: createRedemptionInstructionFromDiscriminatorValue,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type WithPublisherItemRequestBuilder } from './item/index.js';
|
|
2
|
+
import { type BaseRequestBuilder, type Guid, type KeysToExcludeForNavigationMetadata, type NavigationMetadata } from '@microsoft/kiota-abstractions';
|
|
3
|
+
export interface AssetPackRequestBuilder extends BaseRequestBuilder<AssetPackRequestBuilder> {
|
|
4
|
+
byPublisherId(publisherId: Guid): WithPublisherItemRequestBuilder;
|
|
5
|
+
}
|
|
6
|
+
export declare const AssetPackRequestBuilderUriTemplate = "{+baseurl}/AssetPack";
|
|
7
|
+
export declare const AssetPackRequestBuilderNavigationMetadata: Record<Exclude<keyof AssetPackRequestBuilder, KeysToExcludeForNavigationMetadata>, NavigationMetadata>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { WithPublisherItemRequestBuilderNavigationMetadata } from './item/index.js';
|
|
2
|
+
export const AssetPackRequestBuilderUriTemplate = "{+baseurl}/AssetPack";
|
|
3
|
+
export const AssetPackRequestBuilderNavigationMetadata = {
|
|
4
|
+
byPublisherId: {
|
|
5
|
+
navigationMetadata: WithPublisherItemRequestBuilderNavigationMetadata,
|
|
6
|
+
pathParametersMappings: ["publisherId"],
|
|
7
|
+
},
|
|
8
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type WithProductItemRequestBuilder } from './item/index.js';
|
|
2
|
+
import { type BaseRequestBuilder, type Guid, type KeysToExcludeForNavigationMetadata, type NavigationMetadata } from '@microsoft/kiota-abstractions';
|
|
3
|
+
export interface WithPublisherItemRequestBuilder extends BaseRequestBuilder<WithPublisherItemRequestBuilder> {
|
|
4
|
+
byProductId(productId: Guid): WithProductItemRequestBuilder;
|
|
5
|
+
}
|
|
6
|
+
export declare const WithPublisherItemRequestBuilderUriTemplate = "{+baseurl}/AssetPack/{publisherId}";
|
|
7
|
+
export declare const WithPublisherItemRequestBuilderNavigationMetadata: Record<Exclude<keyof WithPublisherItemRequestBuilder, KeysToExcludeForNavigationMetadata>, NavigationMetadata>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WithProductItemRequestBuilderNavigationMetadata, WithProductItemRequestBuilderRequestsMetadata } from './item/index.js';
|
|
2
|
+
export const WithPublisherItemRequestBuilderUriTemplate = "{+baseurl}/AssetPack/{publisherId}";
|
|
3
|
+
export const WithPublisherItemRequestBuilderNavigationMetadata = {
|
|
4
|
+
byProductId: {
|
|
5
|
+
requestsMetadata: WithProductItemRequestBuilderRequestsMetadata,
|
|
6
|
+
navigationMetadata: WithProductItemRequestBuilderNavigationMetadata,
|
|
7
|
+
pathParametersMappings: ["productId"],
|
|
8
|
+
},
|
|
9
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type AssetPackListResult } from '../../../models/index.js';
|
|
2
|
+
import { type WithAssetPackItemRequestBuilder } from './item/index.js';
|
|
3
|
+
import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
|
|
4
|
+
export interface WithProductItemRequestBuilder extends BaseRequestBuilder<WithProductItemRequestBuilder> {
|
|
5
|
+
byAssetPackId(assetPackId: string): WithAssetPackItemRequestBuilder;
|
|
6
|
+
get(requestConfiguration?: RequestConfiguration<object> | undefined): Promise<AssetPackListResult | undefined>;
|
|
7
|
+
toGetRequestInformation(requestConfiguration?: RequestConfiguration<object> | undefined): RequestInformation;
|
|
8
|
+
}
|
|
9
|
+
export declare const WithProductItemRequestBuilderUriTemplate = "{+baseurl}/AssetPack/{publisherId}/{productId}";
|
|
10
|
+
export declare const WithProductItemRequestBuilderNavigationMetadata: Record<Exclude<keyof WithProductItemRequestBuilder, KeysToExcludeForNavigationMetadata>, NavigationMetadata>;
|
|
11
|
+
export declare const WithProductItemRequestBuilderRequestsMetadata: RequestsMetadata;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createAssetPackListResultFromDiscriminatorValue, createProblemDetailsFromDiscriminatorValue } from '../../../models/index.js';
|
|
2
|
+
import { WithAssetPackItemRequestBuilderRequestsMetadata } from './item/index.js';
|
|
3
|
+
export const WithProductItemRequestBuilderUriTemplate = "{+baseurl}/AssetPack/{publisherId}/{productId}";
|
|
4
|
+
export const WithProductItemRequestBuilderNavigationMetadata = {
|
|
5
|
+
byAssetPackId: {
|
|
6
|
+
requestsMetadata: WithAssetPackItemRequestBuilderRequestsMetadata,
|
|
7
|
+
pathParametersMappings: ["assetPackId"],
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export const WithProductItemRequestBuilderRequestsMetadata = {
|
|
11
|
+
get: {
|
|
12
|
+
uriTemplate: WithProductItemRequestBuilderUriTemplate,
|
|
13
|
+
responseBodyContentType: "application/json, text/plain;q=0.9",
|
|
14
|
+
errorMappings: {
|
|
15
|
+
400: createProblemDetailsFromDiscriminatorValue,
|
|
16
|
+
500: createProblemDetailsFromDiscriminatorValue,
|
|
17
|
+
},
|
|
18
|
+
adapterMethodName: "send",
|
|
19
|
+
responseBodyFactory: createAssetPackListResultFromDiscriminatorValue,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AssetPackDetail } from '../../../../models/index.js';
|
|
2
|
+
import { type BaseRequestBuilder, type RequestConfiguration, type RequestInformation, type RequestsMetadata } from '@microsoft/kiota-abstractions';
|
|
3
|
+
export interface WithAssetPackItemRequestBuilder extends BaseRequestBuilder<WithAssetPackItemRequestBuilder> {
|
|
4
|
+
get(requestConfiguration?: RequestConfiguration<object> | undefined): Promise<AssetPackDetail | undefined>;
|
|
5
|
+
toGetRequestInformation(requestConfiguration?: RequestConfiguration<object> | undefined): RequestInformation;
|
|
6
|
+
}
|
|
7
|
+
export declare const WithAssetPackItemRequestBuilderUriTemplate = "{+baseurl}/AssetPack/{publisherId}/{productId}/{assetPackId}";
|
|
8
|
+
export declare const WithAssetPackItemRequestBuilderRequestsMetadata: RequestsMetadata;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createAssetPackDetailFromDiscriminatorValue, createProblemDetailsFromDiscriminatorValue } from '../../../../models/index.js';
|
|
2
|
+
export const WithAssetPackItemRequestBuilderUriTemplate = "{+baseurl}/AssetPack/{publisherId}/{productId}/{assetPackId}";
|
|
3
|
+
export const WithAssetPackItemRequestBuilderRequestsMetadata = {
|
|
4
|
+
get: {
|
|
5
|
+
uriTemplate: WithAssetPackItemRequestBuilderUriTemplate,
|
|
6
|
+
responseBodyContentType: "application/json, text/plain;q=0.9",
|
|
7
|
+
errorMappings: {
|
|
8
|
+
400: createProblemDetailsFromDiscriminatorValue,
|
|
9
|
+
500: createProblemDetailsFromDiscriminatorValue,
|
|
10
|
+
},
|
|
11
|
+
adapterMethodName: "send",
|
|
12
|
+
responseBodyFactory: createAssetPackDetailFromDiscriminatorValue,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type AssetPackRequestBuilder } from './assetPack/index.js';
|
|
2
|
+
import { type BaseRequestBuilder, type KeysToExcludeForNavigationMetadata, type NavigationMetadata, type RequestAdapter } from '@microsoft/kiota-abstractions';
|
|
3
|
+
export interface AssetsClient extends BaseRequestBuilder<AssetsClient> {
|
|
4
|
+
get assetPack(): AssetPackRequestBuilder;
|
|
5
|
+
}
|
|
6
|
+
export declare function createAssetsClient(requestAdapter: RequestAdapter): AssetsClient;
|
|
7
|
+
export declare const AssetsClientUriTemplate = "{+baseurl}";
|
|
8
|
+
export declare const AssetsClientNavigationMetadata: Record<Exclude<keyof AssetsClient, KeysToExcludeForNavigationMetadata>, NavigationMetadata>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AssetPackRequestBuilderNavigationMetadata } from './assetPack/index.js';
|
|
2
|
+
import { apiClientProxifier } from '@microsoft/kiota-abstractions';
|
|
3
|
+
import { FormParseNodeFactory, FormSerializationWriterFactory } from '@microsoft/kiota-serialization-form';
|
|
4
|
+
import { JsonParseNodeFactory, JsonSerializationWriterFactory } from '@microsoft/kiota-serialization-json';
|
|
5
|
+
import { MultipartSerializationWriterFactory } from '@microsoft/kiota-serialization-multipart';
|
|
6
|
+
import { TextParseNodeFactory, TextSerializationWriterFactory } from '@microsoft/kiota-serialization-text';
|
|
7
|
+
export function createAssetsClient(requestAdapter) {
|
|
8
|
+
if (requestAdapter === undefined) {
|
|
9
|
+
throw new Error("requestAdapter cannot be undefined");
|
|
10
|
+
}
|
|
11
|
+
const serializationWriterFactory = requestAdapter.getSerializationWriterFactory();
|
|
12
|
+
const parseNodeFactoryRegistry = requestAdapter.getParseNodeFactory();
|
|
13
|
+
const backingStoreFactory = requestAdapter.getBackingStoreFactory();
|
|
14
|
+
if (parseNodeFactoryRegistry.registerDefaultDeserializer) {
|
|
15
|
+
parseNodeFactoryRegistry.registerDefaultDeserializer(JsonParseNodeFactory, backingStoreFactory);
|
|
16
|
+
parseNodeFactoryRegistry.registerDefaultDeserializer(TextParseNodeFactory, backingStoreFactory);
|
|
17
|
+
parseNodeFactoryRegistry.registerDefaultDeserializer(FormParseNodeFactory, backingStoreFactory);
|
|
18
|
+
}
|
|
19
|
+
if (serializationWriterFactory.registerDefaultSerializer) {
|
|
20
|
+
serializationWriterFactory.registerDefaultSerializer(JsonSerializationWriterFactory);
|
|
21
|
+
serializationWriterFactory.registerDefaultSerializer(TextSerializationWriterFactory);
|
|
22
|
+
serializationWriterFactory.registerDefaultSerializer(FormSerializationWriterFactory);
|
|
23
|
+
serializationWriterFactory.registerDefaultSerializer(MultipartSerializationWriterFactory);
|
|
24
|
+
}
|
|
25
|
+
if (requestAdapter.baseUrl === undefined || requestAdapter.baseUrl === null || requestAdapter.baseUrl === "") {
|
|
26
|
+
requestAdapter.baseUrl = "https://api.missioncontrol.io/assets/partnerApi/v1";
|
|
27
|
+
}
|
|
28
|
+
const pathParameters = {
|
|
29
|
+
"baseurl": requestAdapter.baseUrl,
|
|
30
|
+
};
|
|
31
|
+
return apiClientProxifier(requestAdapter, pathParameters, AssetsClientNavigationMetadata, undefined);
|
|
32
|
+
}
|
|
33
|
+
export const AssetsClientUriTemplate = "{+baseurl}";
|
|
34
|
+
export const AssetsClientNavigationMetadata = {
|
|
35
|
+
assetPack: {
|
|
36
|
+
navigationMetadata: AssetPackRequestBuilderNavigationMetadata,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type AdditionalDataHolder, type ApiError, type Guid, type Parsable, type ParseNode, type SerializationWriter } from '@microsoft/kiota-abstractions';
|
|
2
|
+
export interface Asset extends Parsable {
|
|
3
|
+
embargo?: Date | null;
|
|
4
|
+
fileName?: string | null;
|
|
5
|
+
folder?: string | null;
|
|
6
|
+
height?: number | null;
|
|
7
|
+
lastModified?: Date | null;
|
|
8
|
+
url?: string | null;
|
|
9
|
+
width?: number | null;
|
|
10
|
+
}
|
|
11
|
+
export interface AssetPack extends Parsable {
|
|
12
|
+
countryCodes?: string[] | null;
|
|
13
|
+
id?: string | null;
|
|
14
|
+
lastModified?: Date | null;
|
|
15
|
+
name?: string | null;
|
|
16
|
+
productId?: Guid | null;
|
|
17
|
+
productName?: string | null;
|
|
18
|
+
}
|
|
19
|
+
export interface AssetPackDetail extends Parsable {
|
|
20
|
+
assets?: Asset[] | null;
|
|
21
|
+
countryCodes?: string[] | null;
|
|
22
|
+
id?: string | null;
|
|
23
|
+
lastModified?: Date | null;
|
|
24
|
+
name?: string | null;
|
|
25
|
+
productId?: Guid | null;
|
|
26
|
+
productName?: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface AssetPackListResult extends Parsable {
|
|
29
|
+
pageCount?: number | null;
|
|
30
|
+
result?: AssetPack[] | null;
|
|
31
|
+
totalCount?: number | null;
|
|
32
|
+
}
|
|
33
|
+
export declare function createAssetFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
|
|
34
|
+
export declare function createAssetPackDetailFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
|
|
35
|
+
export declare function createAssetPackFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
|
|
36
|
+
export declare function createAssetPackListResultFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
|
|
37
|
+
export declare function createProblemDetailsFromDiscriminatorValue(parseNode: ParseNode | undefined): ((instance?: Parsable) => Record<string, (node: ParseNode) => void>);
|
|
38
|
+
export declare function deserializeIntoAsset(asset?: Partial<Asset> | undefined): Record<string, (node: ParseNode) => void>;
|
|
39
|
+
export declare function deserializeIntoAssetPack(assetPack?: Partial<AssetPack> | undefined): Record<string, (node: ParseNode) => void>;
|
|
40
|
+
export declare function deserializeIntoAssetPackDetail(assetPackDetail?: Partial<AssetPackDetail> | undefined): Record<string, (node: ParseNode) => void>;
|
|
41
|
+
export declare function deserializeIntoAssetPackListResult(assetPackListResult?: Partial<AssetPackListResult> | undefined): Record<string, (node: ParseNode) => void>;
|
|
42
|
+
export declare function deserializeIntoProblemDetails(problemDetails?: Partial<ProblemDetails> | undefined): Record<string, (node: ParseNode) => void>;
|
|
43
|
+
export interface ProblemDetails extends AdditionalDataHolder, ApiError, Parsable {
|
|
44
|
+
detail?: string | null;
|
|
45
|
+
instance?: string | null;
|
|
46
|
+
status?: number | null;
|
|
47
|
+
title?: string | null;
|
|
48
|
+
type?: string | null;
|
|
49
|
+
}
|
|
50
|
+
export declare function serializeAsset(writer: SerializationWriter, asset?: Partial<Asset> | undefined | null, isSerializingDerivedType?: boolean): void;
|
|
51
|
+
export declare function serializeAssetPack(writer: SerializationWriter, assetPack?: Partial<AssetPack> | undefined | null, isSerializingDerivedType?: boolean): void;
|
|
52
|
+
export declare function serializeAssetPackDetail(writer: SerializationWriter, assetPackDetail?: Partial<AssetPackDetail> | undefined | null, isSerializingDerivedType?: boolean): void;
|
|
53
|
+
export declare function serializeAssetPackListResult(writer: SerializationWriter, assetPackListResult?: Partial<AssetPackListResult> | undefined | null, isSerializingDerivedType?: boolean): void;
|
|
54
|
+
export declare function serializeProblemDetails(writer: SerializationWriter, problemDetails?: Partial<ProblemDetails> | undefined | null, isSerializingDerivedType?: boolean): void;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export function createAssetFromDiscriminatorValue(parseNode) {
|
|
2
|
+
return deserializeIntoAsset;
|
|
3
|
+
}
|
|
4
|
+
export function createAssetPackDetailFromDiscriminatorValue(parseNode) {
|
|
5
|
+
return deserializeIntoAssetPackDetail;
|
|
6
|
+
}
|
|
7
|
+
export function createAssetPackFromDiscriminatorValue(parseNode) {
|
|
8
|
+
return deserializeIntoAssetPack;
|
|
9
|
+
}
|
|
10
|
+
export function createAssetPackListResultFromDiscriminatorValue(parseNode) {
|
|
11
|
+
return deserializeIntoAssetPackListResult;
|
|
12
|
+
}
|
|
13
|
+
export function createProblemDetailsFromDiscriminatorValue(parseNode) {
|
|
14
|
+
return deserializeIntoProblemDetails;
|
|
15
|
+
}
|
|
16
|
+
export function deserializeIntoAsset(asset = {}) {
|
|
17
|
+
return {
|
|
18
|
+
"embargo": n => { asset.embargo = n.getDateValue(); },
|
|
19
|
+
"fileName": n => { asset.fileName = n.getStringValue(); },
|
|
20
|
+
"folder": n => { asset.folder = n.getStringValue(); },
|
|
21
|
+
"height": n => { asset.height = n.getNumberValue(); },
|
|
22
|
+
"lastModified": n => { asset.lastModified = n.getDateValue(); },
|
|
23
|
+
"url": n => { asset.url = n.getStringValue(); },
|
|
24
|
+
"width": n => { asset.width = n.getNumberValue(); },
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export function deserializeIntoAssetPack(assetPack = {}) {
|
|
28
|
+
return {
|
|
29
|
+
"countryCodes": n => { assetPack.countryCodes = n.getCollectionOfPrimitiveValues("string"); },
|
|
30
|
+
"id": n => { assetPack.id = n.getStringValue(); },
|
|
31
|
+
"lastModified": n => { assetPack.lastModified = n.getDateValue(); },
|
|
32
|
+
"name": n => { assetPack.name = n.getStringValue(); },
|
|
33
|
+
"productId": n => { assetPack.productId = n.getGuidValue(); },
|
|
34
|
+
"productName": n => { assetPack.productName = n.getStringValue(); },
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function deserializeIntoAssetPackDetail(assetPackDetail = {}) {
|
|
38
|
+
return {
|
|
39
|
+
"assets": n => { assetPackDetail.assets = n.getCollectionOfObjectValues(createAssetFromDiscriminatorValue); },
|
|
40
|
+
"countryCodes": n => { assetPackDetail.countryCodes = n.getCollectionOfPrimitiveValues("string"); },
|
|
41
|
+
"id": n => { assetPackDetail.id = n.getStringValue(); },
|
|
42
|
+
"lastModified": n => { assetPackDetail.lastModified = n.getDateValue(); },
|
|
43
|
+
"name": n => { assetPackDetail.name = n.getStringValue(); },
|
|
44
|
+
"productId": n => { assetPackDetail.productId = n.getGuidValue(); },
|
|
45
|
+
"productName": n => { assetPackDetail.productName = n.getStringValue(); },
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function deserializeIntoAssetPackListResult(assetPackListResult = {}) {
|
|
49
|
+
return {
|
|
50
|
+
"pageCount": n => { assetPackListResult.pageCount = n.getNumberValue(); },
|
|
51
|
+
"result": n => { assetPackListResult.result = n.getCollectionOfObjectValues(createAssetPackFromDiscriminatorValue); },
|
|
52
|
+
"totalCount": n => { assetPackListResult.totalCount = n.getNumberValue(); },
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export function deserializeIntoProblemDetails(problemDetails = {}) {
|
|
56
|
+
return {
|
|
57
|
+
"detail": n => { problemDetails.detail = n.getStringValue(); },
|
|
58
|
+
"instance": n => { problemDetails.instance = n.getStringValue(); },
|
|
59
|
+
"status": n => { problemDetails.status = n.getNumberValue(); },
|
|
60
|
+
"title": n => { problemDetails.title = n.getStringValue(); },
|
|
61
|
+
"type": n => { problemDetails.type = n.getStringValue(); },
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export function serializeAsset(writer, asset = {}, isSerializingDerivedType = false) {
|
|
65
|
+
if (!asset || isSerializingDerivedType) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
writer.writeDateValue("embargo", asset.embargo);
|
|
69
|
+
writer.writeStringValue("fileName", asset.fileName);
|
|
70
|
+
writer.writeStringValue("folder", asset.folder);
|
|
71
|
+
writer.writeNumberValue("height", asset.height);
|
|
72
|
+
writer.writeDateValue("lastModified", asset.lastModified);
|
|
73
|
+
writer.writeStringValue("url", asset.url);
|
|
74
|
+
writer.writeNumberValue("width", asset.width);
|
|
75
|
+
}
|
|
76
|
+
export function serializeAssetPack(writer, assetPack = {}, isSerializingDerivedType = false) {
|
|
77
|
+
if (!assetPack || isSerializingDerivedType) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
writer.writeCollectionOfPrimitiveValues("countryCodes", assetPack.countryCodes);
|
|
81
|
+
writer.writeStringValue("id", assetPack.id);
|
|
82
|
+
writer.writeDateValue("lastModified", assetPack.lastModified);
|
|
83
|
+
writer.writeStringValue("name", assetPack.name);
|
|
84
|
+
writer.writeGuidValue("productId", assetPack.productId);
|
|
85
|
+
writer.writeStringValue("productName", assetPack.productName);
|
|
86
|
+
}
|
|
87
|
+
export function serializeAssetPackDetail(writer, assetPackDetail = {}, isSerializingDerivedType = false) {
|
|
88
|
+
if (!assetPackDetail || isSerializingDerivedType) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
writer.writeCollectionOfObjectValues("assets", assetPackDetail.assets, serializeAsset);
|
|
92
|
+
writer.writeCollectionOfPrimitiveValues("countryCodes", assetPackDetail.countryCodes);
|
|
93
|
+
writer.writeStringValue("id", assetPackDetail.id);
|
|
94
|
+
writer.writeDateValue("lastModified", assetPackDetail.lastModified);
|
|
95
|
+
writer.writeStringValue("name", assetPackDetail.name);
|
|
96
|
+
writer.writeGuidValue("productId", assetPackDetail.productId);
|
|
97
|
+
writer.writeStringValue("productName", assetPackDetail.productName);
|
|
98
|
+
}
|
|
99
|
+
export function serializeAssetPackListResult(writer, assetPackListResult = {}, isSerializingDerivedType = false) {
|
|
100
|
+
if (!assetPackListResult || isSerializingDerivedType) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
writer.writeNumberValue("pageCount", assetPackListResult.pageCount);
|
|
104
|
+
writer.writeCollectionOfObjectValues("result", assetPackListResult.result, serializeAssetPack);
|
|
105
|
+
writer.writeNumberValue("totalCount", assetPackListResult.totalCount);
|
|
106
|
+
}
|
|
107
|
+
export function serializeProblemDetails(writer, problemDetails = {}, isSerializingDerivedType = false) {
|
|
108
|
+
if (!problemDetails || isSerializingDerivedType) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
writer.writeStringValue("detail", problemDetails.detail);
|
|
112
|
+
writer.writeStringValue("instance", problemDetails.instance);
|
|
113
|
+
writer.writeNumberValue("status", problemDetails.status);
|
|
114
|
+
writer.writeStringValue("title", problemDetails.title);
|
|
115
|
+
writer.writeStringValue("type", problemDetails.type);
|
|
116
|
+
writer.writeAdditionalData(problemDetails.additionalData);
|
|
117
|
+
}
|
|
@@ -3,4 +3,5 @@ export declare enum MissionControlEnvironment {
|
|
|
3
3
|
Production = "Production"
|
|
4
4
|
}
|
|
5
5
|
export declare function getBaseUrl(env: MissionControlEnvironment): string;
|
|
6
|
+
export declare function getAssetsBaseUrl(env: MissionControlEnvironment): string;
|
|
6
7
|
export declare function getScope(env: MissionControlEnvironment): string;
|
|
@@ -6,16 +6,21 @@ export var MissionControlEnvironment;
|
|
|
6
6
|
const settings = {
|
|
7
7
|
[MissionControlEnvironment.Sandbox]: {
|
|
8
8
|
baseUrl: "https://api.sandbox.missioncontrol.io/partnerApi/v2",
|
|
9
|
+
assetsBaseUrl: "https://api.sandbox.missioncontrol.io/assets/partnerApi/v1",
|
|
9
10
|
scope: "api://38fbfaea-5648-4b51-ac09-d5d90117beff/.default",
|
|
10
11
|
},
|
|
11
12
|
[MissionControlEnvironment.Production]: {
|
|
12
13
|
baseUrl: "https://api.missioncontrol.io/partnerApi/v2",
|
|
14
|
+
assetsBaseUrl: "https://api.missioncontrol.io/assets/partnerApi/v1",
|
|
13
15
|
scope: "api://1b6f40bc-e051-4b7e-987f-47a4a19fa5ef/.default",
|
|
14
16
|
},
|
|
15
17
|
};
|
|
16
18
|
export function getBaseUrl(env) {
|
|
17
19
|
return settings[env].baseUrl;
|
|
18
20
|
}
|
|
21
|
+
export function getAssetsBaseUrl(env) {
|
|
22
|
+
return settings[env].assetsBaseUrl;
|
|
23
|
+
}
|
|
19
24
|
export function getScope(env) {
|
|
20
25
|
return settings[env].scope;
|
|
21
26
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export { ClientBuilder } from "./client/clientBuilder.js";
|
|
2
|
-
export { MissionControlEnvironment, getBaseUrl, getScope, } from "./client/missionControlEnvironment.js";
|
|
1
|
+
export { ClientBuilder, type MissionControlClient } from "./client/clientBuilder.js";
|
|
2
|
+
export { MissionControlEnvironment, getAssetsBaseUrl, getBaseUrl, getScope, } from "./client/missionControlEnvironment.js";
|
|
3
3
|
export type { Client } from "./client/generated/client.js";
|
|
4
4
|
export { createClient } from "./client/generated/client.js";
|
|
5
5
|
export type * from "./client/generated/models/index.js";
|
|
6
|
+
export type { AssetsClient } from "./client/generatedAssets/assetsClient.js";
|
|
7
|
+
export type { Asset, AssetPack, AssetPackDetail, AssetPackListResult, } from "./client/generatedAssets/models/index.js";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { ClientBuilder } from "./client/clientBuilder.js";
|
|
2
|
-
export { MissionControlEnvironment, getBaseUrl, getScope, } from "./client/missionControlEnvironment.js";
|
|
2
|
+
export { MissionControlEnvironment, getAssetsBaseUrl, getBaseUrl, getScope, } from "./client/missionControlEnvironment.js";
|
|
3
3
|
export { createClient } from "./client/generated/client.js";
|
package/package.json
CHANGED