@compassdigital/sdk.typescript 4.690.0 → 4.691.0
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/lib/base.d.ts.map +1 -1
- package/lib/base.js +8 -0
- package/lib/base.js.map +1 -1
- package/lib/interface/consumer.d.ts +35 -35
- package/lib/interface/consumer.d.ts.map +1 -1
- package/lib/interface/menu.d.ts +5 -0
- package/lib/interface/menu.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/base.ts +7 -0
- package/src/interface/consumer.ts +56 -56
- package/src/interface/menu.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compassdigital/sdk.typescript",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.691.0",
|
|
4
4
|
"description": "Compass Digital Labs TypeScript SDK",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@compassdigital/review": "^7.6.3",
|
|
61
|
-
"@compassdigital/sdk.typescript.cli": "^4.
|
|
61
|
+
"@compassdigital/sdk.typescript.cli": "^4.61.0",
|
|
62
62
|
"@swc/core": "^1.4.1",
|
|
63
63
|
"@swc/jest": "^0.2.36",
|
|
64
64
|
"@types/jest": "^30.0.0",
|
package/src/base.ts
CHANGED
|
@@ -414,6 +414,13 @@ export abstract class BaseServiceClient {
|
|
|
414
414
|
* Determine the base url to use.
|
|
415
415
|
*/
|
|
416
416
|
private base_url(service: string, { base_url, stage }: RequestOptions): string {
|
|
417
|
+
// An empty base_url falls back to the runtime origin (browser/jsdom),
|
|
418
|
+
// resolving requests the way a browser fetch would; in Node there is
|
|
419
|
+
// no origin, so the url stays relative.
|
|
420
|
+
if (base_url === '') {
|
|
421
|
+
const global: { location?: { origin?: string } } = globalThis;
|
|
422
|
+
return this.clean_url(global.location?.origin ?? '');
|
|
423
|
+
}
|
|
417
424
|
// use the base url if one was provided.
|
|
418
425
|
if (typeof base_url === 'string') {
|
|
419
426
|
return this.clean_url(base_url);
|
|
@@ -1765,6 +1765,61 @@ export interface ConsumerGetActiveMenusResponse {
|
|
|
1765
1765
|
menus: ConsumerMenuHours[];
|
|
1766
1766
|
}
|
|
1767
1767
|
|
|
1768
|
+
export interface MenuRecipeAllergenConsumer {
|
|
1769
|
+
// Allergen key for localization, icons, and filtering
|
|
1770
|
+
key?: string;
|
|
1771
|
+
// Allergen name
|
|
1772
|
+
name?: string;
|
|
1773
|
+
// Allergen contains status: 'Yes' or 'AtRisk'
|
|
1774
|
+
contains?: 'Yes' | 'AtRisk';
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
export interface GetMenuItemRecipeConsumerV2 {
|
|
1778
|
+
// Smart tags
|
|
1779
|
+
smart_tags?: string[];
|
|
1780
|
+
// Allergen tags
|
|
1781
|
+
allergen_tags?: string[];
|
|
1782
|
+
// MenuWorks MRN
|
|
1783
|
+
mrn?: string;
|
|
1784
|
+
// MenuWorks unit ID
|
|
1785
|
+
unit_id?: string;
|
|
1786
|
+
// MenuWorks portion quantity
|
|
1787
|
+
portion_quantity?: number;
|
|
1788
|
+
// MenuWorks portion unit name
|
|
1789
|
+
portion_unit_name?: string;
|
|
1790
|
+
// MenuWorks grams
|
|
1791
|
+
grams?: number;
|
|
1792
|
+
// MenuWorks cost per serving
|
|
1793
|
+
cost?: number;
|
|
1794
|
+
// MenuWorks ingredients
|
|
1795
|
+
ingredients?: string[];
|
|
1796
|
+
// MenuWorks allergens with contains field
|
|
1797
|
+
allergens?: MenuRecipeAllergenConsumer[];
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
export interface GetMenuItemMetaConsumerV2 {
|
|
1801
|
+
// Barcodes of the item
|
|
1802
|
+
barcodes?: string[];
|
|
1803
|
+
// Recipe metadata
|
|
1804
|
+
recipe?: GetMenuItemRecipeConsumerV2;
|
|
1805
|
+
superplate?: {
|
|
1806
|
+
type_id?: number;
|
|
1807
|
+
type?: string;
|
|
1808
|
+
};
|
|
1809
|
+
// Chit sort order
|
|
1810
|
+
sort_number?: number;
|
|
1811
|
+
// Menu sort order
|
|
1812
|
+
menu_sort_number?: number;
|
|
1813
|
+
// Unique ID of the entity
|
|
1814
|
+
unique_id?: number;
|
|
1815
|
+
tax?: {
|
|
1816
|
+
tax_tag_code?: string;
|
|
1817
|
+
tax_jwo_code?: string;
|
|
1818
|
+
tax_rate?: number;
|
|
1819
|
+
tax_amount?: number;
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1768
1823
|
export interface ConsumerOption {
|
|
1769
1824
|
// Metadata for the option
|
|
1770
1825
|
meta?: Record<string, any>;
|
|
@@ -1838,7 +1893,7 @@ export interface ConsumerOptionsGroup {
|
|
|
1838
1893
|
|
|
1839
1894
|
export interface ConsumerItem {
|
|
1840
1895
|
// Metadata for the item
|
|
1841
|
-
meta?:
|
|
1896
|
+
meta?: GetMenuItemMetaConsumerV2;
|
|
1842
1897
|
id?: string;
|
|
1843
1898
|
label?: {
|
|
1844
1899
|
en?: string;
|
|
@@ -2120,15 +2175,6 @@ export interface GetMenuItemOptionsGroupConsumer {
|
|
|
2120
2175
|
meta?: GetMenuItemGroupMetaConsumer;
|
|
2121
2176
|
}
|
|
2122
2177
|
|
|
2123
|
-
export interface MenuRecipeAllergenConsumer {
|
|
2124
|
-
// Allergen key for localization, icons, and filtering
|
|
2125
|
-
key?: string;
|
|
2126
|
-
// Allergen name
|
|
2127
|
-
name?: string;
|
|
2128
|
-
// Allergen contains status: 'Yes' or 'AtRisk'
|
|
2129
|
-
contains?: 'Yes' | 'AtRisk';
|
|
2130
|
-
}
|
|
2131
|
-
|
|
2132
2178
|
export interface GetMenuItemRecipeConsumer {
|
|
2133
2179
|
// Smart tags
|
|
2134
2180
|
smart_tags?: string[];
|
|
@@ -2508,52 +2554,6 @@ export interface GetMenuItemOptionsGroupConsumerV2 {
|
|
|
2508
2554
|
meta?: GetMenuItemGroupMetaConsumerV2;
|
|
2509
2555
|
}
|
|
2510
2556
|
|
|
2511
|
-
export interface GetMenuItemRecipeConsumerV2 {
|
|
2512
|
-
// Smart tags
|
|
2513
|
-
smart_tags?: string[];
|
|
2514
|
-
// Allergen tags
|
|
2515
|
-
allergen_tags?: string[];
|
|
2516
|
-
// MenuWorks MRN
|
|
2517
|
-
mrn?: string;
|
|
2518
|
-
// MenuWorks unit ID
|
|
2519
|
-
unit_id?: string;
|
|
2520
|
-
// MenuWorks portion quantity
|
|
2521
|
-
portion_quantity?: number;
|
|
2522
|
-
// MenuWorks portion unit name
|
|
2523
|
-
portion_unit_name?: string;
|
|
2524
|
-
// MenuWorks grams
|
|
2525
|
-
grams?: number;
|
|
2526
|
-
// MenuWorks cost per serving
|
|
2527
|
-
cost?: number;
|
|
2528
|
-
// MenuWorks ingredients
|
|
2529
|
-
ingredients?: string[];
|
|
2530
|
-
// MenuWorks allergens with contains field
|
|
2531
|
-
allergens?: MenuRecipeAllergenConsumer[];
|
|
2532
|
-
}
|
|
2533
|
-
|
|
2534
|
-
export interface GetMenuItemMetaConsumerV2 {
|
|
2535
|
-
// Barcodes of the item
|
|
2536
|
-
barcodes?: string[];
|
|
2537
|
-
// Recipe metadata
|
|
2538
|
-
recipe?: GetMenuItemRecipeConsumerV2;
|
|
2539
|
-
superplate?: {
|
|
2540
|
-
type_id?: number;
|
|
2541
|
-
type?: string;
|
|
2542
|
-
};
|
|
2543
|
-
// Chit sort order
|
|
2544
|
-
sort_number?: number;
|
|
2545
|
-
// Menu sort order
|
|
2546
|
-
menu_sort_number?: number;
|
|
2547
|
-
// Unique ID of the entity
|
|
2548
|
-
unique_id?: number;
|
|
2549
|
-
tax?: {
|
|
2550
|
-
tax_tag_code?: string;
|
|
2551
|
-
tax_jwo_code?: string;
|
|
2552
|
-
tax_rate?: number;
|
|
2553
|
-
tax_amount?: number;
|
|
2554
|
-
};
|
|
2555
|
-
}
|
|
2556
|
-
|
|
2557
2557
|
export interface GetMenuItemIsConsumerV2 {
|
|
2558
2558
|
// Is the item disabled
|
|
2559
2559
|
disabled?: boolean;
|
package/src/interface/menu.ts
CHANGED
|
@@ -619,6 +619,12 @@ export interface UnauthorizedErrorDTO {
|
|
|
619
619
|
[index: string]: any;
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
+
export interface ForbiddenErrorDTO {
|
|
623
|
+
number: number;
|
|
624
|
+
message: string;
|
|
625
|
+
[index: string]: any;
|
|
626
|
+
}
|
|
627
|
+
|
|
622
628
|
export interface InternalServerErrorDTO {
|
|
623
629
|
number: number;
|
|
624
630
|
message: string;
|