squarecommonblhelper 11.2.0 → 11.3.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/README.md
CHANGED
|
@@ -1,247 +1,18 @@
|
|
|
1
1
|
# squareCommonBLHelper
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
> 📌 versioning: see [CHANGELOG.md](./CHANGELOG.md).
|
|
4
|
+
|
|
3
5
|
## about
|
|
4
|
-
|
|
6
|
+
|
|
5
7
|
helper for common bl for my projects.
|
|
6
|
-
|
|
8
|
+
|
|
7
9
|
## usage
|
|
8
|
-
|
|
10
|
+
|
|
9
11
|
[Example](./example.js)
|
|
10
|
-
|
|
12
|
+
|
|
11
13
|
## env
|
|
12
|
-
|
|
14
|
+
|
|
13
15
|
1. node js - v18.17.0
|
|
14
16
|
2. npm - v9.6.7
|
|
15
|
-
|
|
16
|
-
## changelog
|
|
17
|
-
|
|
18
|
-
### v11.2.0
|
|
19
|
-
|
|
20
|
-
- AuthenticationCommonBL:
|
|
21
|
-
- update getUserRecoveryMethodsV0 response type.
|
|
22
|
-
|
|
23
|
-
### v11.1.0
|
|
24
|
-
|
|
25
|
-
- all:
|
|
26
|
-
- add new optional parameter logErrors to all methods.
|
|
27
|
-
|
|
28
|
-
### v11.0.0
|
|
29
|
-
|
|
30
|
-
- AuthenticationCommonBL:
|
|
31
|
-
- UpdateUserProfilePhotoV0Response now compatible with square_common_bl>=7.0.0
|
|
32
|
-
|
|
33
|
-
### v10.1.0
|
|
34
|
-
|
|
35
|
-
- AuthenticationCommonBL:
|
|
36
|
-
- add UpdateUserProfilePhotoV0ResponseZ.
|
|
37
|
-
|
|
38
|
-
### v10.0.0
|
|
39
|
-
|
|
40
|
-
- AuthenticationCommonBL:
|
|
41
|
-
- **breaking change**, rename the following types to match the standard naming convention:
|
|
42
|
-
- UpdateProfileDetailsV0ResponseZ
|
|
43
|
-
- SendResetPasswordEmailV0ResponseZ
|
|
44
|
-
- UpdateUserRecoveryMethodsV0ResponseZ
|
|
45
|
-
- SendVerificationEmailV0ResponseZ
|
|
46
|
-
- ValidateEmailVerificationCodeV0ResponseZ
|
|
47
|
-
|
|
48
|
-
### v9.3.1
|
|
49
|
-
|
|
50
|
-
- AuthenticationCommonBL:
|
|
51
|
-
- fix type of backup_code_details in GetUserDetailsV0ResponseZ.
|
|
52
|
-
|
|
53
|
-
### v9.3.0
|
|
54
|
-
|
|
55
|
-
- AuthenticationCommonBL:
|
|
56
|
-
- add backup_code_details in GetUserDetailsV0ResponseZ.
|
|
57
|
-
|
|
58
|
-
### v9.2.3
|
|
59
|
-
|
|
60
|
-
- AuthenticationCommonBL:
|
|
61
|
-
- updateUserRecoveryMethodsV0 now compatible with square_common_bl>=6.0.0
|
|
62
|
-
|
|
63
|
-
### v9.2.2
|
|
64
|
-
|
|
65
|
-
- AuthenticationCommonBL:
|
|
66
|
-
- bugfix in updateUserRecoveryMethodsV0 query parameters (string[] instead of comma separated list).
|
|
67
|
-
|
|
68
|
-
### v9.2.1
|
|
69
|
-
|
|
70
|
-
- AuthenticationCommonBL:
|
|
71
|
-
- update type of GetUserDetailsV0ResponseZ and GetUserRecoveryMethodsV0ResponseZ to include RecoveryMethodEnumZ as key instead of random string.
|
|
72
|
-
|
|
73
|
-
### v9.2.0
|
|
74
|
-
|
|
75
|
-
- AuthenticationCommonBL:
|
|
76
|
-
- add getUserRecoveryMethodsV0.
|
|
77
|
-
|
|
78
|
-
### v9.1.0
|
|
79
|
-
|
|
80
|
-
- AuthenticationCommonBL:
|
|
81
|
-
- add email_verification_details in GetUserDetailsV0ResponseZ.
|
|
82
|
-
|
|
83
|
-
### v9.0.2
|
|
84
|
-
|
|
85
|
-
- AuthenticationCommonBL:
|
|
86
|
-
- add recovery_methods in GetUserDetailsV0ResponseZ.
|
|
87
|
-
|
|
88
|
-
### v9.0.1
|
|
89
|
-
|
|
90
|
-
- AuthenticationCommonBL:
|
|
91
|
-
- add user_profile_phone_number_country_code and user_profile_email_verified in GetUserDetailsV0ResponseZ.
|
|
92
|
-
|
|
93
|
-
### v9.0.0
|
|
94
|
-
|
|
95
|
-
- AuthenticationCommonBL:
|
|
96
|
-
- **breaking change**: remove user_profile_username from GetUserDetailsV0ResponseZ.
|
|
97
|
-
|
|
98
|
-
### v8.0.1
|
|
99
|
-
|
|
100
|
-
- AuthenticationCommonBL:
|
|
101
|
-
- add username to GetUserDetailsV0ResponseZ.
|
|
102
|
-
|
|
103
|
-
### v8.0.0
|
|
104
|
-
|
|
105
|
-
- AuthenticationCommonBL:
|
|
106
|
-
- **breaking change**, rename the following types to match the standard naming convention:
|
|
107
|
-
- DeleteUserV0ResponseZ
|
|
108
|
-
- LogoutAllV0ResponseZ
|
|
109
|
-
- LogoutAppsV0ResponseZ
|
|
110
|
-
- GenerateAccountBackupCodeV0ResponseZ
|
|
111
|
-
- updateProfileDetailsV0ResponseZ
|
|
112
|
-
|
|
113
|
-
### v7.0.0
|
|
114
|
-
|
|
115
|
-
- GreetingCommonBL:
|
|
116
|
-
- **breaking change**: replace createGreetingV0 with createAnonymousGreetingV0.
|
|
117
|
-
|
|
118
|
-
### v6.1.0
|
|
119
|
-
|
|
120
|
-
- AuthenticationCommonBL:
|
|
121
|
-
- update output types of sendResetPasswordEmailV0ResponseZ and sendVerificationEmailV0ResponseZ.
|
|
122
|
-
|
|
123
|
-
### v6.0.0
|
|
124
|
-
|
|
125
|
-
- AuthenticationCommonBL:
|
|
126
|
-
- **breaking change** remove updatePasswordV0.
|
|
127
|
-
- add generateAccountBackupCodesV0.
|
|
128
|
-
- method changed of deleteUserV0 from delete to post.
|
|
129
|
-
- add updateProfileDetailsV0.
|
|
130
|
-
- add sendResetPasswordEmailV0.
|
|
131
|
-
- add updateUserRecoveryMethodsV0.
|
|
132
|
-
- add sendVerificationEmailV0.
|
|
133
|
-
- add validateEmailVerificationCodeV0.
|
|
134
|
-
|
|
135
|
-
### v5.2.1
|
|
136
|
-
|
|
137
|
-
- AuthenticationCommonBL:
|
|
138
|
-
- fix url in updateUserProfilePhotoV0.
|
|
139
|
-
|
|
140
|
-
### v5.2.0
|
|
141
|
-
|
|
142
|
-
- AuthenticationCommonBL:
|
|
143
|
-
- add updateUserProfilePhotoV0.
|
|
144
|
-
- rename getUserProfilePhoto to getUserProfilePhotoV0.
|
|
145
|
-
|
|
146
|
-
### v5.1.0
|
|
147
|
-
|
|
148
|
-
- AuthenticationCommonBL:
|
|
149
|
-
- add getUserProfilePhoto.
|
|
150
|
-
|
|
151
|
-
### v5.0.0
|
|
152
|
-
|
|
153
|
-
- AuthenticationCommonBL:
|
|
154
|
-
- change type for GetUserDetailsV0ResponseZ to make it compatible with latest changes.
|
|
155
|
-
|
|
156
|
-
### v4.2.0
|
|
157
|
-
|
|
158
|
-
- AuthenticationCommonBL:
|
|
159
|
-
- add logoutAppsV0.
|
|
160
|
-
|
|
161
|
-
### v4.1.0
|
|
162
|
-
|
|
163
|
-
- AuthenticationCommonBL:
|
|
164
|
-
- add logoutAllV0.
|
|
165
|
-
|
|
166
|
-
### v4.0.0
|
|
167
|
-
|
|
168
|
-
- AuthenticationCommonBL:
|
|
169
|
-
- change type for GetUserDetailsV0ResponseZ to make it compatible with latest changes.
|
|
170
|
-
|
|
171
|
-
### v3.0.0
|
|
172
|
-
|
|
173
|
-
- AuthenticationCommonBL:
|
|
174
|
-
- remove generateAccessTokenV0, logoutV0.
|
|
175
|
-
|
|
176
|
-
### v2.0.1
|
|
177
|
-
|
|
178
|
-
- use strictObject in zod.
|
|
179
|
-
- export types in index file.
|
|
180
|
-
|
|
181
|
-
### v2.0.0
|
|
182
|
-
|
|
183
|
-
- remove UtilsCommonBL
|
|
184
|
-
|
|
185
|
-
### v1.8.0
|
|
186
|
-
|
|
187
|
-
- AuthenticationCommonBL:
|
|
188
|
-
- add types for deleteUserV0
|
|
189
|
-
|
|
190
|
-
### v1.7.0
|
|
191
|
-
|
|
192
|
-
- AuthenticationCommonBL:
|
|
193
|
-
- add types for logoutV0
|
|
194
|
-
|
|
195
|
-
### v1.6.0
|
|
196
|
-
|
|
197
|
-
- AuthenticationCommonBL:
|
|
198
|
-
- add types for getUserDetailsV0
|
|
199
|
-
|
|
200
|
-
### v1.5.0
|
|
201
|
-
|
|
202
|
-
- AuthenticationCommonBL:
|
|
203
|
-
- add types for updatePasswordV0
|
|
204
|
-
|
|
205
|
-
### v1.4.0
|
|
206
|
-
|
|
207
|
-
- AuthenticationCommonBL:
|
|
208
|
-
- bug fix in updateUsernameV0
|
|
209
|
-
- add types for updateUsernameV0
|
|
210
|
-
|
|
211
|
-
### v1.3.0
|
|
212
|
-
|
|
213
|
-
- add types in AuthenticationCommonBL:
|
|
214
|
-
- generateAccessTokenV0
|
|
215
|
-
|
|
216
|
-
### v1.2.0
|
|
217
|
-
|
|
218
|
-
- add types in greeting:
|
|
219
|
-
- createGreetingV0
|
|
220
|
-
|
|
221
|
-
### v1.1.0
|
|
222
|
-
|
|
223
|
-
- add AuthenticationCommonBL class with the following methods:
|
|
224
|
-
- logoutV0
|
|
225
|
-
- generateAccessTokenV0
|
|
226
|
-
- deleteUserV0
|
|
227
|
-
- updateUsernameV0
|
|
228
|
-
- updatePasswordV0
|
|
229
|
-
- getUserDetailsV0
|
|
230
|
-
|
|
231
|
-
### v1.0.3
|
|
232
|
-
|
|
233
|
-
- experimental release.
|
|
234
|
-
|
|
235
|
-
### v1.0.2
|
|
236
|
-
|
|
237
|
-
- replace user_id with accessToken from greeting -> createGreetingV0.
|
|
238
|
-
|
|
239
|
-
### v1.0.1
|
|
240
|
-
|
|
241
|
-
- remove app_id from greeting -> createGreetingV0.
|
|
242
|
-
|
|
243
|
-
### v1.0.0
|
|
244
|
-
|
|
245
|
-
- initial implementation.
|
|
246
|
-
|
|
17
|
+
|
|
247
18
|
## Feedback is appreciated. Thank you!
|
package/dist/authentication.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ declare class AuthenticationCommonBL {
|
|
|
48
48
|
available: number;
|
|
49
49
|
generated_at: string;
|
|
50
50
|
} | null;
|
|
51
|
+
auth_providers: string[];
|
|
51
52
|
};
|
|
52
53
|
};
|
|
53
54
|
log?: any;
|
|
@@ -135,11 +136,11 @@ declare class AuthenticationCommonBL {
|
|
|
135
136
|
total: number;
|
|
136
137
|
available: number;
|
|
137
138
|
generated_at: string;
|
|
138
|
-
};
|
|
139
|
+
} | null;
|
|
139
140
|
email_recovery_details: {
|
|
140
141
|
expires_at: string;
|
|
141
142
|
cooldown_reset_at: string;
|
|
142
|
-
};
|
|
143
|
+
} | null;
|
|
143
144
|
};
|
|
144
145
|
log?: any;
|
|
145
146
|
}>;
|
|
@@ -120,6 +120,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
120
120
|
available: number;
|
|
121
121
|
generated_at: string;
|
|
122
122
|
}>>;
|
|
123
|
+
auth_providers: z.ZodArray<z.ZodString, "many">;
|
|
123
124
|
}, "strict", z.ZodTypeAny, {
|
|
124
125
|
user_id: string;
|
|
125
126
|
username: string;
|
|
@@ -148,6 +149,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
148
149
|
available: number;
|
|
149
150
|
generated_at: string;
|
|
150
151
|
} | null;
|
|
152
|
+
auth_providers: string[];
|
|
151
153
|
}, {
|
|
152
154
|
user_id: string;
|
|
153
155
|
username: string;
|
|
@@ -176,6 +178,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
176
178
|
available: number;
|
|
177
179
|
generated_at: string;
|
|
178
180
|
} | null;
|
|
181
|
+
auth_providers: string[];
|
|
179
182
|
}>;
|
|
180
183
|
}, "strict", z.ZodTypeAny, {
|
|
181
184
|
main: {
|
|
@@ -206,6 +209,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
206
209
|
available: number;
|
|
207
210
|
generated_at: string;
|
|
208
211
|
} | null;
|
|
212
|
+
auth_providers: string[];
|
|
209
213
|
};
|
|
210
214
|
}, {
|
|
211
215
|
main: {
|
|
@@ -236,6 +240,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
236
240
|
available: number;
|
|
237
241
|
generated_at: string;
|
|
238
242
|
} | null;
|
|
243
|
+
auth_providers: string[];
|
|
239
244
|
};
|
|
240
245
|
}>;
|
|
241
246
|
}>, "strict", z.ZodTypeAny, {
|
|
@@ -269,6 +274,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
269
274
|
available: number;
|
|
270
275
|
generated_at: string;
|
|
271
276
|
} | null;
|
|
277
|
+
auth_providers: string[];
|
|
272
278
|
};
|
|
273
279
|
};
|
|
274
280
|
log?: any;
|
|
@@ -303,6 +309,7 @@ declare const GetUserDetailsV0ResponseZ: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
303
309
|
available: number;
|
|
304
310
|
generated_at: string;
|
|
305
311
|
} | null;
|
|
312
|
+
auth_providers: string[];
|
|
306
313
|
};
|
|
307
314
|
};
|
|
308
315
|
log?: any;
|
|
@@ -620,7 +627,7 @@ declare const GetUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.extend
|
|
|
620
627
|
}, {
|
|
621
628
|
data: z.ZodObject<{
|
|
622
629
|
main: z.ZodRecord<z.ZodEnum<["EMAIL", "BACKUP_CODE"]>, z.ZodBoolean>;
|
|
623
|
-
email_recovery_details: z.ZodObject<{
|
|
630
|
+
email_recovery_details: z.ZodNullable<z.ZodObject<{
|
|
624
631
|
expires_at: z.ZodString;
|
|
625
632
|
cooldown_reset_at: z.ZodString;
|
|
626
633
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -629,8 +636,8 @@ declare const GetUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.extend
|
|
|
629
636
|
}, {
|
|
630
637
|
expires_at: string;
|
|
631
638
|
cooldown_reset_at: string;
|
|
632
|
-
}
|
|
633
|
-
backup_code_details: z.ZodObject<{
|
|
639
|
+
}>>;
|
|
640
|
+
backup_code_details: z.ZodNullable<z.ZodObject<{
|
|
634
641
|
total: z.ZodNumber;
|
|
635
642
|
available: z.ZodNumber;
|
|
636
643
|
generated_at: z.ZodString;
|
|
@@ -642,29 +649,29 @@ declare const GetUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.extend
|
|
|
642
649
|
total: number;
|
|
643
650
|
available: number;
|
|
644
651
|
generated_at: string;
|
|
645
|
-
}
|
|
652
|
+
}>>;
|
|
646
653
|
}, "strict", z.ZodTypeAny, {
|
|
647
654
|
main: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
648
655
|
backup_code_details: {
|
|
649
656
|
total: number;
|
|
650
657
|
available: number;
|
|
651
658
|
generated_at: string;
|
|
652
|
-
};
|
|
659
|
+
} | null;
|
|
653
660
|
email_recovery_details: {
|
|
654
661
|
expires_at: string;
|
|
655
662
|
cooldown_reset_at: string;
|
|
656
|
-
};
|
|
663
|
+
} | null;
|
|
657
664
|
}, {
|
|
658
665
|
main: Partial<Record<"EMAIL" | "BACKUP_CODE", boolean>>;
|
|
659
666
|
backup_code_details: {
|
|
660
667
|
total: number;
|
|
661
668
|
available: number;
|
|
662
669
|
generated_at: string;
|
|
663
|
-
};
|
|
670
|
+
} | null;
|
|
664
671
|
email_recovery_details: {
|
|
665
672
|
expires_at: string;
|
|
666
673
|
cooldown_reset_at: string;
|
|
667
|
-
};
|
|
674
|
+
} | null;
|
|
668
675
|
}>;
|
|
669
676
|
}>, "strict", z.ZodTypeAny, {
|
|
670
677
|
message: string | null;
|
|
@@ -674,11 +681,11 @@ declare const GetUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.extend
|
|
|
674
681
|
total: number;
|
|
675
682
|
available: number;
|
|
676
683
|
generated_at: string;
|
|
677
|
-
};
|
|
684
|
+
} | null;
|
|
678
685
|
email_recovery_details: {
|
|
679
686
|
expires_at: string;
|
|
680
687
|
cooldown_reset_at: string;
|
|
681
|
-
};
|
|
688
|
+
} | null;
|
|
682
689
|
};
|
|
683
690
|
log?: any;
|
|
684
691
|
}, {
|
|
@@ -689,11 +696,11 @@ declare const GetUserRecoveryMethodsV0ResponseZ: z.ZodObject<z.objectUtil.extend
|
|
|
689
696
|
total: number;
|
|
690
697
|
available: number;
|
|
691
698
|
generated_at: string;
|
|
692
|
-
};
|
|
699
|
+
} | null;
|
|
693
700
|
email_recovery_details: {
|
|
694
701
|
expires_at: string;
|
|
695
702
|
cooldown_reset_at: string;
|
|
696
|
-
};
|
|
703
|
+
} | null;
|
|
697
704
|
};
|
|
698
705
|
log?: any;
|
|
699
706
|
}>;
|
|
@@ -40,6 +40,7 @@ const GetUserDetailsV0ResponseZ = APIOutputZ.extend({
|
|
|
40
40
|
generated_at: z.string(),
|
|
41
41
|
})
|
|
42
42
|
.nullable(),
|
|
43
|
+
auth_providers: z.array(z.string()),
|
|
43
44
|
}),
|
|
44
45
|
}),
|
|
45
46
|
});
|
|
@@ -100,15 +101,19 @@ const ValidateEmailVerificationCodeV0ResponseZ = APIOutputZ.extend({
|
|
|
100
101
|
const GetUserRecoveryMethodsV0ResponseZ = APIOutputZ.extend({
|
|
101
102
|
data: z.strictObject({
|
|
102
103
|
main: z.record(RecoveryMethodEnumZ, z.boolean()),
|
|
103
|
-
email_recovery_details: z
|
|
104
|
+
email_recovery_details: z
|
|
105
|
+
.strictObject({
|
|
104
106
|
expires_at: z.string(),
|
|
105
107
|
cooldown_reset_at: z.string(),
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
+
})
|
|
109
|
+
.nullable(),
|
|
110
|
+
backup_code_details: z
|
|
111
|
+
.strictObject({
|
|
108
112
|
total: z.number(),
|
|
109
113
|
available: z.number(),
|
|
110
114
|
generated_at: z.string(),
|
|
111
|
-
})
|
|
115
|
+
})
|
|
116
|
+
.nullable(),
|
|
112
117
|
}),
|
|
113
118
|
});
|
|
114
119
|
const UpdateUserProfilePhotoV0ResponseZ = APIOutputZ.extend({
|