@compassdigital/sdk.typescript 3.0.0-rc.2 → 3.0.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": "3.0.0-rc.2",
3
+ "version": "3.0.0",
4
4
  "description": "Compass Digital Labs TypeScript SDK",
5
5
  "type": "commonjs",
6
6
  "bin": "./bin/index.js",
@@ -21,11 +21,14 @@
21
21
  }
22
22
  },
23
23
  "jest": {
24
- "preset": "ts-jest",
25
- "testEnvironment": "node"
24
+ "testEnvironment": "node",
25
+ "transform": {
26
+ "^.+\\.tsx?$": "esbuild-jest"
27
+ }
26
28
  },
27
29
  "scripts": {
28
30
  "test": "jest",
31
+ "build": "",
29
32
  "gen": "ts-node gen.ts --manifest ./manifest.json && tsc",
30
33
  "prepare": "rimraf ./lib && tsc && tsc --esModuleInterop --outDir ./bin gen.ts"
31
34
  },
@@ -35,17 +38,19 @@
35
38
  "cross-fetch": "^3.1.4"
36
39
  },
37
40
  "devDependencies": {
38
- "@icholy/openapi-ts": "^2.5.1",
41
+ "@icholy/openapi-ts": "^2.6.0",
39
42
  "@types/ejs": "^3.1.0",
40
43
  "@types/jest": "^27.0.1",
41
44
  "@types/node": "^16.7.2",
42
45
  "@types/prettier": "^2.3.2",
43
46
  "ejs": "^3.1.6",
47
+ "esbuild": "^0.13.15",
48
+ "esbuild-jest": "^0.5.0",
44
49
  "jest": "^27.1.0",
45
50
  "prettier": "^2.3.2",
46
51
  "rimraf": "^3.0.2",
47
- "ts-jest": "^27.0.5",
48
52
  "ts-node": "^10.2.1",
53
+ "typescript": "^4.5.2",
49
54
  "yargs": "^17.1.1"
50
55
  }
51
56
  }
package/src/index.ts CHANGED
@@ -154,6 +154,8 @@ import {
154
154
  PatchLocationCompanyResponse,
155
155
  GetLocationBrandExternalQuery,
156
156
  GetLocationBrandExternalResponse,
157
+ DeleteLocationRecordQuery,
158
+ DeleteLocationRecordResponse,
157
159
  } from "./interface/location";
158
160
 
159
161
  import {
@@ -396,6 +398,9 @@ import {
396
398
  PostUserSendEmailVerificationResponse,
397
399
  PutUserVerifyUserEmailBody,
398
400
  PutUserVerifyUserEmailResponse,
401
+ PostUserVerificationPhoneQuery,
402
+ PostUserVerificationPhoneBody,
403
+ PostUserVerificationPhoneResponse,
399
404
  PutUserVerificationPhoneBody,
400
405
  PutUserVerificationPhoneResponse,
401
406
  } from "./interface/user";
@@ -444,6 +449,7 @@ import {
444
449
  GetCalendarResponse,
445
450
  PutCalendarBody,
446
451
  PutCalendarResponse,
452
+ DeleteCalendarResponse,
447
453
  GetCalendarCdlQuery,
448
454
  GetCalendarCdlResponse,
449
455
  GetCalendarSwaggerResponse,
@@ -475,7 +481,12 @@ import {
475
481
  GetVoteIdfaResponse,
476
482
  } from "./interface/vote";
477
483
 
478
- import { PostFileBody, PostFileResponse } from "./interface/file";
484
+ import {
485
+ PostFileBody,
486
+ PostFileResponse,
487
+ DeleteFileBody,
488
+ DeleteFileResponse,
489
+ } from "./interface/file";
479
490
 
480
491
  import { PostMessageBody, PostMessageResponse, GetMessageResponse } from "./interface/message";
481
492
 
@@ -2069,6 +2080,28 @@ export class ServiceClient extends BaseServiceClient {
2069
2080
  );
2070
2081
  }
2071
2082
 
2083
+ /**
2084
+ * DELETE /location/record/{id} - Delete a Brand, Location, Group, or MultiGroup
2085
+ *
2086
+ * @param id - brand, location, group, or multigroup id
2087
+ * @param options - additional request options
2088
+ */
2089
+ delete_location_record(
2090
+ id: string,
2091
+ options?: {
2092
+ query?: DeleteLocationRecordQuery;
2093
+ } & RequestOptions
2094
+ ): ResponsePromise<DeleteLocationRecordResponse> {
2095
+ return this.request(
2096
+ "location",
2097
+ "delete_location_record",
2098
+ "delete",
2099
+ `/location/record/${id}`,
2100
+ null,
2101
+ options
2102
+ );
2103
+ }
2104
+
2072
2105
  /**
2073
2106
  * POST /shoppingcart/ - Create a new ShoppingCart
2074
2107
  *
@@ -4232,7 +4265,31 @@ export class ServiceClient extends BaseServiceClient {
4232
4265
  }
4233
4266
 
4234
4267
  /**
4235
- * PUT /user/{id}/verification/phone - Send phone verification to user
4268
+ * POST /user/{id}/verification/phone - Send phone verification to user
4269
+ *
4270
+ * @param id - realm
4271
+ * @param body - User phone number to be verified
4272
+ * @param options - additional request options
4273
+ */
4274
+ post_user_verification_phone(
4275
+ id: string,
4276
+ body: PostUserVerificationPhoneBody,
4277
+ options?: {
4278
+ query?: PostUserVerificationPhoneQuery;
4279
+ } & RequestOptions
4280
+ ): ResponsePromise<PostUserVerificationPhoneResponse> {
4281
+ return this.request(
4282
+ "user",
4283
+ "post_user_verification_phone",
4284
+ "post",
4285
+ `/user/${id}/verification/phone`,
4286
+ body,
4287
+ options
4288
+ );
4289
+ }
4290
+
4291
+ /**
4292
+ * PUT /user/{id}/verification/phone - Attempt phone verification for user
4236
4293
  *
4237
4294
  * @param id - realm
4238
4295
  * @param body
@@ -4746,6 +4803,16 @@ export class ServiceClient extends BaseServiceClient {
4746
4803
  return this.request("calendar", "put_calendar", "put", `/calendar/${id}`, body, options);
4747
4804
  }
4748
4805
 
4806
+ /**
4807
+ * DELETE /calendar/{id} - Delete a calendar.
4808
+ *
4809
+ * @param id - brand
4810
+ * @param options - additional request options
4811
+ */
4812
+ delete_calendar(id: string, options?: RequestOptions): ResponsePromise<DeleteCalendarResponse> {
4813
+ return this.request("calendar", "delete_calendar", "delete", `/calendar/${id}`, null, options);
4814
+ }
4815
+
4749
4816
  /**
4750
4817
  * GET /calendar/{id}/cdl - Get the calendar events in a CDL compatible format for next 7 days
4751
4818
  *
@@ -4960,6 +5027,16 @@ export class ServiceClient extends BaseServiceClient {
4960
5027
  return this.request("file", "post_file", "post", `/file`, body, options);
4961
5028
  }
4962
5029
 
5030
+ /**
5031
+ * DELETE /file - Delete a file from CDL S3
5032
+ *
5033
+ * @param body
5034
+ * @param options - additional request options
5035
+ */
5036
+ delete_file(body: DeleteFileBody, options?: RequestOptions): ResponsePromise<DeleteFileResponse> {
5037
+ return this.request("file", "delete_file", "delete", `/file`, body, options);
5038
+ }
5039
+
4963
5040
  /**
4964
5041
  * POST /message - Create a Message
4965
5042
  *
@@ -88,6 +88,17 @@ export interface PutCalendarRequest extends PutCalendarPath {
88
88
  body: PutCalendarBody;
89
89
  }
90
90
 
91
+ // DELETE /calendar/{id} - Delete a calendar.
92
+
93
+ export interface DeleteCalendarPath {
94
+ // brand
95
+ id: string;
96
+ }
97
+
98
+ export type DeleteCalendarResponse = Success;
99
+
100
+ export interface DeleteCalendarRequest extends DeleteCalendarPath {}
101
+
91
102
  // GET /calendar/{id}/cdl - Get the calendar events in a CDL compatible format for next 7 days
92
103
 
93
104
  export interface GetCalendarCdlPath {
@@ -25,3 +25,20 @@ export type PostFileResponse = File;
25
25
  export interface PostFileRequest {
26
26
  body: PostFileBody;
27
27
  }
28
+
29
+ // DELETE /file - Delete a file from CDL S3
30
+
31
+ export interface DeleteFileBody {
32
+ // Specify the bucket name
33
+ bucket_name: string;
34
+ // Specify the full S3 file path
35
+ file_path: string;
36
+ }
37
+
38
+ export interface DeleteFileResponse {
39
+ success?: boolean;
40
+ }
41
+
42
+ export interface DeleteFileRequest {
43
+ body: DeleteFileBody;
44
+ }
@@ -1235,3 +1235,21 @@ export type GetLocationBrandExternalResponse = Location;
1235
1235
  export interface GetLocationBrandExternalRequest
1236
1236
  extends GetLocationBrandExternalQuery,
1237
1237
  GetLocationBrandExternalPath {}
1238
+
1239
+ // DELETE /location/record/{id} - Delete a Brand, Location, Group, or MultiGroup
1240
+
1241
+ export interface DeleteLocationRecordPath {
1242
+ // brand, location, group, or multigroup id
1243
+ id: string;
1244
+ }
1245
+
1246
+ export interface DeleteLocationRecordQuery {
1247
+ // Don't delete the record
1248
+ dryrun?: boolean;
1249
+ }
1250
+
1251
+ export type DeleteLocationRecordResponse = any;
1252
+
1253
+ export interface DeleteLocationRecordRequest
1254
+ extends DeleteLocationRecordQuery,
1255
+ DeleteLocationRecordPath {}
@@ -98,14 +98,17 @@ export interface Order {
98
98
  ready?: boolean;
99
99
  out_for_delivery?: boolean;
100
100
  delivered?: boolean;
101
+ checkin_order?: boolean;
101
102
  };
102
103
  date?: {
104
+ accepted?: string;
103
105
  created?: string;
104
106
  modified?: string;
105
107
  should_start?: string;
106
108
  completion_warning?: string;
107
109
  ready?: string;
108
110
  started?: string;
111
+ show_as_active_until?: string;
109
112
  };
110
113
  pickup?: string;
111
114
  pickup_name?: string;
@@ -351,6 +351,7 @@ export interface LocationGroup {
351
351
  fr?: string;
352
352
  };
353
353
  };
354
+ external_id?: string;
354
355
  [index: string]: any;
355
356
  }[];
356
357
  meta?: any;
@@ -19,6 +19,7 @@ export interface User {
19
19
  };
20
20
  birthday?: string;
21
21
  password?: string;
22
+ // User phone number
22
23
  phone?: number;
23
24
  // realm
24
25
  realm?: string;
@@ -596,7 +597,31 @@ export interface PutUserVerifyUserEmailRequest extends PutUserVerifyUserEmailPat
596
597
  body: PutUserVerifyUserEmailBody;
597
598
  }
598
599
 
599
- // PUT /user/{id}/verification/phone - Send phone verification to user
600
+ // POST /user/{id}/verification/phone - Send phone verification to user
601
+
602
+ export interface PostUserVerificationPhonePath {
603
+ // realm
604
+ id: string;
605
+ }
606
+
607
+ export interface PostUserVerificationPhoneQuery {
608
+ // The language of the sms, currently en, fr supported.
609
+ lang?: string;
610
+ }
611
+
612
+ export interface PostUserVerificationPhoneBody {
613
+ phone: string;
614
+ }
615
+
616
+ export type PostUserVerificationPhoneResponse = success;
617
+
618
+ export interface PostUserVerificationPhoneRequest
619
+ extends PostUserVerificationPhoneQuery,
620
+ PostUserVerificationPhonePath {
621
+ body: PostUserVerificationPhoneBody;
622
+ }
623
+
624
+ // PUT /user/{id}/verification/phone - Attempt phone verification for user
600
625
 
601
626
  export interface PutUserVerificationPhonePath {
602
627
  // realm
@@ -604,8 +629,8 @@ export interface PutUserVerificationPhonePath {
604
629
  }
605
630
 
606
631
  export interface PutUserVerificationPhoneBody {
607
- // User phone number to be verified
608
- phone: string;
632
+ // Phone verification code
633
+ verification_code: string;
609
634
  }
610
635
 
611
636
  export type PutUserVerificationPhoneResponse = success;