@compassdigital/sdk.typescript 4.44.0 → 4.46.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compassdigital/sdk.typescript",
3
- "version": "4.44.0",
3
+ "version": "4.46.0",
4
4
  "description": "Compass Digital Labs TypeScript SDK",
5
5
  "type": "commonjs",
6
6
  "main": "./lib/index.js",
@@ -46,12 +46,12 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@compassdigital/review": "^7.3.0",
49
- "@compassdigital/sdk.typescript.cli": "^4.16.0",
49
+ "@compassdigital/sdk.typescript.cli": "^4.17.1",
50
50
  "@swc/core": "^1.4.1",
51
51
  "@swc/jest": "^0.2.36",
52
52
  "@types/jest": "^29.2.4",
53
53
  "@types/node": "^20.1.0",
54
- "esbuild": "^0.20.0",
54
+ "esbuild": "^0.21.1",
55
55
  "jest": "^29.7.0",
56
56
  "rimraf": "^5.0.0",
57
57
  "typescript": "^5.0.2"
package/src/base.ts CHANGED
@@ -326,7 +326,9 @@ export abstract class BaseServiceClient {
326
326
  * Combine the route and query parameters into a full url.
327
327
  */
328
328
  private build_url(route: string, service: string, { base_url, stage = "dev" }: RequestOptions, params: any): string {
329
- let url = `https://api.compassdigital.org/${stage}${route}`;
329
+ let url = stage === 'v1'
330
+ ? `https://api.compassdigital.org${route}`
331
+ : `https://${stage}.api.compassdigital.org${route}`;
330
332
  // use the base url if one was provided.
331
333
  if (base_url) {
332
334
  if (typeof base_url === 'object' && base_url[service]) base_url = base_url[service];
package/src/index.ts CHANGED
@@ -953,8 +953,8 @@ import {
953
953
  } from "./interface/search";
954
954
 
955
955
  import {
956
- GetAuthFlowQuery,
957
- GetAuthFlowResponse,
956
+ PostAuthFlowBody,
957
+ PostAuthFlowResponse,
958
958
  GetAuthSsoConfigsQuery,
959
959
  GetAuthSsoConfigsResponse,
960
960
  PostAuthSsoConfigBody,
@@ -9593,16 +9593,16 @@ export class ServiceClient extends BaseServiceClient {
9593
9593
  }
9594
9594
 
9595
9595
  /**
9596
- * GET /auth/flow - Determines the authentication flow for a user based on their email address
9596
+ * POST /auth/flow - Determines the authentication flow for a user based on their email address
9597
9597
  *
9598
+ * @param body
9598
9599
  * @param options - additional request options
9599
9600
  */
9600
- get_auth_flow(
9601
- options: {
9602
- query: GetAuthFlowQuery;
9603
- } & RequestOptions,
9604
- ): ResponsePromise<GetAuthFlowResponse> {
9605
- return this.request("auth", "get_auth_flow", "get", `/auth/flow`, null, options);
9601
+ post_auth_flow(
9602
+ body: PostAuthFlowBody,
9603
+ options?: RequestOptions,
9604
+ ): ResponsePromise<PostAuthFlowResponse> {
9605
+ return this.request("auth", "post_auth_flow", "post", `/auth/flow`, body, options);
9606
9606
  }
9607
9607
 
9608
9608
  /**
@@ -3,6 +3,12 @@
3
3
 
4
4
  import { RequestQuery, BaseRequest } from "./util";
5
5
 
6
+ export interface SSOFlowRequestDTO {
7
+ email: string;
8
+ realm: string;
9
+ clientId: string;
10
+ }
11
+
6
12
  export interface OIDC {
7
13
  authorizationUrl: string;
8
14
  }
@@ -12,6 +18,14 @@ export interface SSOFlowResponseDTO {
12
18
  oidc?: OIDC;
13
19
  }
14
20
 
21
+ export interface SSOMapping {
22
+ id: string;
23
+ given_name: string;
24
+ family_name: string;
25
+ email: string;
26
+ updated_at: string;
27
+ }
28
+
15
29
  export interface SSOConfigsResponseDTO {
16
30
  name: string;
17
31
  clientId: string;
@@ -19,6 +33,7 @@ export interface SSOConfigsResponseDTO {
19
33
  tokenEndpoint: string;
20
34
  userinfoEndpoint: string;
21
35
  realm: string;
36
+ mapping?: SSOMapping;
22
37
  }
23
38
 
24
39
  export interface SSOConfigRequestDTO {
@@ -30,6 +45,7 @@ export interface SSOConfigRequestDTO {
30
45
  userinfoEndpoint: string;
31
46
  realm: string;
32
47
  protocol: "OIDC" | "SAML2";
48
+ mapping?: SSOMapping;
33
49
  }
34
50
 
35
51
  export interface SSOConfigResponseDTO {
@@ -76,19 +92,15 @@ export interface SSOAuthResponseDTO {
76
92
  profile: Profile;
77
93
  }
78
94
 
79
- // GET /auth/flow - Determines the authentication flow for a user based on their email address
95
+ // POST /auth/flow - Determines the authentication flow for a user based on their email address
80
96
 
81
- export interface GetAuthFlowQuery {
82
- email: string;
83
- realm: string;
84
- clientId: string;
85
- // Graphql query string
86
- _query?: string;
87
- }
97
+ export type PostAuthFlowBody = SSOFlowRequestDTO;
88
98
 
89
- export type GetAuthFlowResponse = SSOFlowResponseDTO;
99
+ export type PostAuthFlowResponse = SSOFlowResponseDTO;
90
100
 
91
- export interface GetAuthFlowRequest extends BaseRequest, RequestQuery<GetAuthFlowQuery> {}
101
+ export interface PostAuthFlowRequest extends BaseRequest {
102
+ body: PostAuthFlowBody;
103
+ }
92
104
 
93
105
  // GET /auth/sso-configs - Returns all available SSO configurations
94
106
 
@@ -343,6 +343,7 @@ export interface DraftBrandDTO {
343
343
  global_menu_group_id?: string;
344
344
  posid_segment?: string;
345
345
  is_simplified_view?: boolean;
346
+ applied_diff_snapshot?: Record<string, any>;
346
347
  permissions?: Record<string, any>;
347
348
  [index: string]: any;
348
349
  }
@@ -555,6 +556,8 @@ export interface DraftItemDTO {
555
556
  id?: string;
556
557
  parent_id?: string;
557
558
  name?: string;
559
+ name_on_receipt?: string;
560
+ name_on_kds?: string;
558
561
  label?: string;
559
562
  description?: string;
560
563
  reporting?: Record<string, any>;
@@ -571,6 +574,7 @@ export interface DraftItemDTO {
571
574
  menu_works?: Record<string, any>;
572
575
  is_out_of_stock?: boolean;
573
576
  tax_tag_code?: string;
577
+ tags?: string[];
574
578
  applied_diff_snapshot?: Record<string, any>;
575
579
  brand?: DraftBrandDTO;
576
580
  categories?: Record<string, any>[];
@@ -653,6 +657,8 @@ export interface DraftModifierDTO {
653
657
  id?: string;
654
658
  parent_id?: string;
655
659
  name?: string;
660
+ name_on_receipt?: string;
661
+ name_on_kds?: string;
656
662
  label?: string;
657
663
  description?: string;
658
664
  price?: number;
@@ -671,6 +677,7 @@ export interface DraftModifierDTO {
671
677
  pre_surcharge?: number;
672
678
  post_surcharge?: number;
673
679
  tax_tag_code?: string;
680
+ tags?: string[];
674
681
  applied_diff_snapshot?: Record<string, any>;
675
682
  brand?: DraftBrandDTO;
676
683
  changes?: ModifierChangeDTO[];
@@ -921,6 +928,8 @@ export interface PublishedItemDTO {
921
928
  id?: string;
922
929
  parent_id?: string;
923
930
  name?: string;
931
+ name_on_receipt?: string;
932
+ name_on_kds?: string;
924
933
  label?: string;
925
934
  description?: string;
926
935
  price?: number;
@@ -935,6 +944,7 @@ export interface PublishedItemDTO {
935
944
  posid_segment?: string;
936
945
  is_out_of_stock?: boolean;
937
946
  tax_tag_code?: string;
947
+ tags?: string[];
938
948
  permissions?: Record<string, any>;
939
949
  [index: string]: any;
940
950
  }
@@ -983,6 +993,8 @@ export interface PublishedModifierDTO {
983
993
  id?: string;
984
994
  parent_id?: string;
985
995
  name?: string;
996
+ name_on_receipt?: string;
997
+ name_on_kds?: string;
986
998
  label?: string;
987
999
  description?: string;
988
1000
  price?: number;
@@ -999,6 +1011,7 @@ export interface PublishedModifierDTO {
999
1011
  pre_surcharge?: number;
1000
1012
  post_surcharge?: number;
1001
1013
  tax_tag_code?: string;
1014
+ tags?: string[];
1002
1015
  permissions?: Record<string, any>;
1003
1016
  [index: string]: any;
1004
1017
  }
@@ -1271,6 +1284,8 @@ export interface DraftItemEntityDTO {
1271
1284
  deleted_at?: string;
1272
1285
  parent_id?: string;
1273
1286
  name: string;
1287
+ name_on_receipt?: string;
1288
+ name_on_kds?: string;
1274
1289
  label?: string;
1275
1290
  description?: string;
1276
1291
  reporting: ReportingMetadataDTO;
@@ -1287,6 +1302,7 @@ export interface DraftItemEntityDTO {
1287
1302
  menu_works?: MenuWorksDTO;
1288
1303
  is_out_of_stock?: boolean;
1289
1304
  tax_tag_code?: string;
1305
+ tags?: string[];
1290
1306
  applied_diff_snapshot?: Record<string, any>;
1291
1307
  version?: number;
1292
1308
  brand?: DraftBrandDTO;
@@ -1309,6 +1325,8 @@ export interface DraftModifierEntityDTO {
1309
1325
  deleted_at?: string;
1310
1326
  parent_id?: string;
1311
1327
  name: string;
1328
+ name_on_receipt?: string;
1329
+ name_on_kds?: string;
1312
1330
  label?: string;
1313
1331
  description?: string;
1314
1332
  price: number;
@@ -1327,6 +1345,7 @@ export interface DraftModifierEntityDTO {
1327
1345
  pre_surcharge?: number;
1328
1346
  post_surcharge?: number;
1329
1347
  tax_tag_code?: string;
1348
+ tags?: string[];
1330
1349
  applied_diff_snapshot?: Record<string, any>;
1331
1350
  version?: number;
1332
1351
  brand?: DraftBrandDTO;
@@ -2562,6 +2581,7 @@ export interface PostMenuV3DraftBrandBody {
2562
2581
  global_menu_group_id?: string;
2563
2582
  posid_segment?: string;
2564
2583
  is_simplified_view?: boolean;
2584
+ applied_diff_snapshot?: Record<string, any>;
2565
2585
  changes?: BrandChangeDTO[];
2566
2586
  local_menu_group?: LocalMenuGroupDTO;
2567
2587
  global_menu_group?: GlobalMenuGroupDTO;
@@ -2627,6 +2647,7 @@ export interface PatchMenuV3DraftBrandBody {
2627
2647
  global_menu_group_id?: string;
2628
2648
  posid_segment?: string;
2629
2649
  is_simplified_view?: boolean;
2650
+ applied_diff_snapshot?: Record<string, any>;
2630
2651
  version?: number;
2631
2652
  changes?: BrandChangeDTO[];
2632
2653
  local_menu_group?: LocalMenuGroupDTO;
@@ -2714,6 +2735,7 @@ export type PostMenuV3DraftBrandsBody = {
2714
2735
  global_menu_group_id?: string;
2715
2736
  posid_segment?: string;
2716
2737
  is_simplified_view?: boolean;
2738
+ applied_diff_snapshot?: Record<string, any>;
2717
2739
  changes?: BrandChangeDTO[];
2718
2740
  local_menu_group?: LocalMenuGroupDTO;
2719
2741
  global_menu_group?: GlobalMenuGroupDTO;
@@ -4238,6 +4260,8 @@ export interface PostMenuV3DraftItemBody {
4238
4260
  modifier_groups?: DraftItemToModifierGroupRelationshipDTO[];
4239
4261
  parent_id?: string;
4240
4262
  name: string;
4263
+ name_on_receipt?: string;
4264
+ name_on_kds?: string;
4241
4265
  label?: string;
4242
4266
  description?: string;
4243
4267
  reporting: ReportingMetadataDTO;
@@ -4254,6 +4278,7 @@ export interface PostMenuV3DraftItemBody {
4254
4278
  menu_works?: MenuWorksDTO;
4255
4279
  is_out_of_stock?: boolean;
4256
4280
  tax_tag_code?: string;
4281
+ tags?: string[];
4257
4282
  applied_diff_snapshot?: Record<string, any>;
4258
4283
  brand?: DraftBrandDTO;
4259
4284
  categories?: DraftCategoryToItemRelationshipDTO[];
@@ -4306,6 +4331,8 @@ export interface PatchMenuV3DraftItemBody {
4306
4331
  id?: string;
4307
4332
  parent_id?: string;
4308
4333
  name?: string;
4334
+ name_on_receipt?: string;
4335
+ name_on_kds?: string;
4309
4336
  label?: string;
4310
4337
  description?: string;
4311
4338
  reporting?: ReportingMetadataDTO;
@@ -4322,6 +4349,7 @@ export interface PatchMenuV3DraftItemBody {
4322
4349
  menu_works?: MenuWorksDTO;
4323
4350
  is_out_of_stock?: boolean;
4324
4351
  tax_tag_code?: string;
4352
+ tags?: string[];
4325
4353
  applied_diff_snapshot?: Record<string, any>;
4326
4354
  version?: number;
4327
4355
  brand?: DraftBrandDTO;
@@ -4396,6 +4424,8 @@ export type PostMenuV3DraftItemsBody = {
4396
4424
  modifier_groups?: DraftItemToModifierGroupRelationshipDTO[];
4397
4425
  parent_id?: string;
4398
4426
  name: string;
4427
+ name_on_receipt?: string;
4428
+ name_on_kds?: string;
4399
4429
  label?: string;
4400
4430
  description?: string;
4401
4431
  reporting: ReportingMetadataDTO;
@@ -4412,6 +4442,7 @@ export type PostMenuV3DraftItemsBody = {
4412
4442
  menu_works?: MenuWorksDTO;
4413
4443
  is_out_of_stock?: boolean;
4414
4444
  tax_tag_code?: string;
4445
+ tags?: string[];
4415
4446
  applied_diff_snapshot?: Record<string, any>;
4416
4447
  brand?: DraftBrandDTO;
4417
4448
  categories?: DraftCategoryToItemRelationshipDTO[];
@@ -4482,6 +4513,8 @@ export interface PatchMenuV3DraftItemsBulkUpdateBody {
4482
4513
  id?: string;
4483
4514
  parent_id?: string;
4484
4515
  name?: string;
4516
+ name_on_receipt?: string;
4517
+ name_on_kds?: string;
4485
4518
  label?: string;
4486
4519
  description?: string;
4487
4520
  reporting?: ReportingMetadataDTO;
@@ -4498,6 +4531,7 @@ export interface PatchMenuV3DraftItemsBulkUpdateBody {
4498
4531
  menu_works?: MenuWorksDTO;
4499
4532
  is_out_of_stock?: boolean;
4500
4533
  tax_tag_code?: string;
4534
+ tags?: string[];
4501
4535
  applied_diff_snapshot?: Record<string, any>;
4502
4536
  brand?: DraftBrandDTO;
4503
4537
  categories?: DraftCategoryToItemRelationshipDTO[];
@@ -5495,6 +5529,8 @@ export interface PostMenuV3DraftModifierBody {
5495
5529
  modifier_groups?: DraftModifierGroupToModifierRelationshipDTO[];
5496
5530
  parent_id?: string;
5497
5531
  name: string;
5532
+ name_on_receipt?: string;
5533
+ name_on_kds?: string;
5498
5534
  label?: string;
5499
5535
  description?: string;
5500
5536
  price: number;
@@ -5513,6 +5549,7 @@ export interface PostMenuV3DraftModifierBody {
5513
5549
  pre_surcharge?: number;
5514
5550
  post_surcharge?: number;
5515
5551
  tax_tag_code?: string;
5552
+ tags?: string[];
5516
5553
  applied_diff_snapshot?: Record<string, any>;
5517
5554
  brand?: DraftBrandDTO;
5518
5555
  changes?: ModifierChangeDTO[];
@@ -5564,6 +5601,8 @@ export interface PatchMenuV3DraftModifierBody {
5564
5601
  id?: string;
5565
5602
  parent_id?: string;
5566
5603
  name?: string;
5604
+ name_on_receipt?: string;
5605
+ name_on_kds?: string;
5567
5606
  label?: string;
5568
5607
  description?: string;
5569
5608
  price?: number;
@@ -5582,6 +5621,7 @@ export interface PatchMenuV3DraftModifierBody {
5582
5621
  pre_surcharge?: number;
5583
5622
  post_surcharge?: number;
5584
5623
  tax_tag_code?: string;
5624
+ tags?: string[];
5585
5625
  applied_diff_snapshot?: Record<string, any>;
5586
5626
  version?: number;
5587
5627
  brand?: DraftBrandDTO;
@@ -5655,6 +5695,8 @@ export type PostMenuV3DraftModifiersBody = {
5655
5695
  modifier_groups?: DraftModifierGroupToModifierRelationshipDTO[];
5656
5696
  parent_id?: string;
5657
5697
  name: string;
5698
+ name_on_receipt?: string;
5699
+ name_on_kds?: string;
5658
5700
  label?: string;
5659
5701
  description?: string;
5660
5702
  price: number;
@@ -5673,6 +5715,7 @@ export type PostMenuV3DraftModifiersBody = {
5673
5715
  pre_surcharge?: number;
5674
5716
  post_surcharge?: number;
5675
5717
  tax_tag_code?: string;
5718
+ tags?: string[];
5676
5719
  applied_diff_snapshot?: Record<string, any>;
5677
5720
  brand?: DraftBrandDTO;
5678
5721
  changes?: ModifierChangeDTO[];
@@ -5721,6 +5764,8 @@ export interface PatchMenuV3DraftModifiersBulkUpdateBody {
5721
5764
  id?: string;
5722
5765
  parent_id?: string;
5723
5766
  name?: string;
5767
+ name_on_receipt?: string;
5768
+ name_on_kds?: string;
5724
5769
  label?: string;
5725
5770
  description?: string;
5726
5771
  price?: number;
@@ -5739,6 +5784,7 @@ export interface PatchMenuV3DraftModifiersBulkUpdateBody {
5739
5784
  pre_surcharge?: number;
5740
5785
  post_surcharge?: number;
5741
5786
  tax_tag_code?: string;
5787
+ tags?: string[];
5742
5788
  applied_diff_snapshot?: Record<string, any>;
5743
5789
  brand?: DraftBrandDTO;
5744
5790
  changes?: ModifierChangeDTO[];
@@ -28,7 +28,7 @@ describe('ServiceClient', () => {
28
28
  expect(req).toEqual({
29
29
  name: 'get_task',
30
30
  service: 'task',
31
- url: 'https://api.compassdigital.org/dev/task/some_id',
31
+ url: 'https://dev.api.compassdigital.org/task/some_id',
32
32
  method: 'get',
33
33
  headers: {
34
34
  'User-Agent': 'CDL/ServiceClient',