@procraft/widget-order 2.30.13 → 2.30.14
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/dist/CourseItem/index.js +9 -1
- package/dist/CourseItem/index.js.map +1 -1
- package/dist/modules/gql/generated/helpers/apollo-helpers.d.ts +91 -17
- package/dist/modules/gql/generated/types.d.ts +74 -8
- package/dist/modules/gql/generated/types.js +12 -1
- package/dist/modules/gql/generated/types.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils.d.ts +12 -0
- package/dist/utils.js +66 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/CourseItem/index.tsx +21 -21
- package/src/modules/gql/generated/helpers/apollo-helpers.ts +97 -23
- package/src/modules/gql/generated/schema.json +763 -42
- package/src/modules/gql/generated/types.ts +81 -8
- package/src/utils.ts +66 -0
|
@@ -43,6 +43,13 @@ export interface AddressInput {
|
|
|
43
43
|
primary?: Maybe<Scalars['Boolean']>;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
export enum AuthMethod {
|
|
47
|
+
SMS = 'Sms',
|
|
48
|
+
EMAIL = 'Email',
|
|
49
|
+
PASSWORD = 'Password',
|
|
50
|
+
TIMELIMITTOKEN = 'TimeLimitToken'
|
|
51
|
+
}
|
|
52
|
+
|
|
46
53
|
|
|
47
54
|
export interface BookingClientInput {
|
|
48
55
|
firstName?: Maybe<Scalars['String']>;
|
|
@@ -70,9 +77,13 @@ export enum CardFieldName {
|
|
|
70
77
|
MESSENGERHANGOUTS = 'MessengerHangouts',
|
|
71
78
|
MESSENGERFACEBOOK = 'MessengerFacebook',
|
|
72
79
|
ATTACHMENTS = 'Attachments',
|
|
80
|
+
PHONE = 'Phone',
|
|
73
81
|
EMAIL = 'Email',
|
|
82
|
+
LASTNAME = 'LastName',
|
|
74
83
|
MIDDLENAME = 'MiddleName',
|
|
75
|
-
ACCEPTAGREEMENTBYDEFAULT = 'AcceptAgreementByDefault'
|
|
84
|
+
ACCEPTAGREEMENTBYDEFAULT = 'AcceptAgreementByDefault',
|
|
85
|
+
SEPARATECHECKBOXONDOCUMENT = 'SeparateCheckboxOnDocument',
|
|
86
|
+
NOTIAMWILLBESTUDY = 'NotIamWillBeStudy'
|
|
76
87
|
}
|
|
77
88
|
|
|
78
89
|
export enum CardFieldState {
|
|
@@ -140,6 +151,18 @@ export enum CatalogFieldValueType {
|
|
|
140
151
|
LESSONCOUNT = 'LessonCount'
|
|
141
152
|
}
|
|
142
153
|
|
|
154
|
+
export interface CatalogItem {
|
|
155
|
+
__typename?: 'CatalogItem';
|
|
156
|
+
internalId?: Maybe<Scalars['Int']>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface CheckoutPosition {
|
|
160
|
+
__typename?: 'CheckoutPosition';
|
|
161
|
+
uid: Scalars['Int'];
|
|
162
|
+
catalogItemId?: Maybe<Scalars['Int']>;
|
|
163
|
+
products?: Maybe<Array<CheckoutProduct>>;
|
|
164
|
+
}
|
|
165
|
+
|
|
143
166
|
export interface CheckoutPriceDetails {
|
|
144
167
|
__typename?: 'CheckoutPriceDetails';
|
|
145
168
|
catalogPrice?: Maybe<Scalars['BigDecimal']>;
|
|
@@ -149,6 +172,13 @@ export interface CheckoutPriceDetails {
|
|
|
149
172
|
subscriptionPrice?: Maybe<Scalars['BigDecimal']>;
|
|
150
173
|
subscriptionFirstPrice?: Maybe<Scalars['BigDecimal']>;
|
|
151
174
|
hasInstallment: Scalars['Boolean'];
|
|
175
|
+
denyReason?: Maybe<Scalars['String']>;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface CheckoutProduct {
|
|
179
|
+
__typename?: 'CheckoutProduct';
|
|
180
|
+
name: Scalars['String'];
|
|
181
|
+
amount: Scalars['BigDecimal'];
|
|
152
182
|
}
|
|
153
183
|
|
|
154
184
|
export interface ClientForm {
|
|
@@ -261,6 +291,7 @@ export interface CourseItemMeta {
|
|
|
261
291
|
courseKind: CourseKind;
|
|
262
292
|
courseSubKindLabel?: Maybe<LangRussianNoun>;
|
|
263
293
|
courseSubKind: CourseSubKind;
|
|
294
|
+
webinarStartsAt?: Maybe<Scalars['String']>;
|
|
264
295
|
}
|
|
265
296
|
|
|
266
297
|
export enum CourseKind {
|
|
@@ -386,6 +417,8 @@ export interface CreateLandingOrderInput {
|
|
|
386
417
|
paymentSchemaIndexes?: Maybe<Array<Scalars['Int']>>;
|
|
387
418
|
/** Поэтапная оплата */
|
|
388
419
|
partialPayment?: Maybe<Scalars['Boolean']>;
|
|
420
|
+
sourceUrl: Scalars['String'];
|
|
421
|
+
timezoneOffset?: Maybe<Scalars['Int']>;
|
|
389
422
|
}
|
|
390
423
|
|
|
391
424
|
export interface CreateLandingTemplateInput {
|
|
@@ -429,6 +462,15 @@ export interface FileMetaInput {
|
|
|
429
462
|
customInfo?: Maybe<Scalars['String']>;
|
|
430
463
|
}
|
|
431
464
|
|
|
465
|
+
export interface FinanceDocument {
|
|
466
|
+
__typename?: 'FinanceDocument';
|
|
467
|
+
uid: Scalars['Int'];
|
|
468
|
+
url: Scalars['String'];
|
|
469
|
+
fileName: Scalars['String'];
|
|
470
|
+
name: Scalars['String'];
|
|
471
|
+
kind: Scalars['String'];
|
|
472
|
+
}
|
|
473
|
+
|
|
432
474
|
export interface FlowPublicCustom {
|
|
433
475
|
__typename?: 'FlowPublicCustom';
|
|
434
476
|
id: Scalars['ID'];
|
|
@@ -462,6 +504,7 @@ export interface LandingOrderPayload {
|
|
|
462
504
|
export interface LandingSite {
|
|
463
505
|
__typename?: 'LandingSite';
|
|
464
506
|
id: Scalars['ID'];
|
|
507
|
+
registerAuthMethod?: Maybe<AuthMethod>;
|
|
465
508
|
cardFields: Array<LandingCardField>;
|
|
466
509
|
background?: Maybe<PhotoData>;
|
|
467
510
|
extraScript?: Maybe<Scalars['String']>;
|
|
@@ -505,6 +548,8 @@ export interface LandingTemplateFragment {
|
|
|
505
548
|
components: Scalars['Json'];
|
|
506
549
|
props: Scalars['Json'];
|
|
507
550
|
uri?: Maybe<Scalars['String']>;
|
|
551
|
+
/** Иконка сайта */
|
|
552
|
+
favicon?: Maybe<PhotoData>;
|
|
508
553
|
}
|
|
509
554
|
|
|
510
555
|
/** Роль пользователя */
|
|
@@ -512,6 +557,7 @@ export interface LandingViewerUserRoleFragment {
|
|
|
512
557
|
__typename?: 'LandingViewerUserRole_Fragment';
|
|
513
558
|
id?: Maybe<Scalars['ID']>;
|
|
514
559
|
uid: Scalars['Int'];
|
|
560
|
+
auths: Array<UserAuth>;
|
|
515
561
|
human: UserHuman;
|
|
516
562
|
contacts: ContactsProfile;
|
|
517
563
|
}
|
|
@@ -552,11 +598,7 @@ export interface MasterProfileCustom {
|
|
|
552
598
|
id: Scalars['ID'];
|
|
553
599
|
uid: Scalars['Int'];
|
|
554
600
|
label?: Maybe<Scalars['String']>;
|
|
555
|
-
|
|
556
|
-
pdfContractOffer?: Maybe<Scalars['String']>;
|
|
557
|
-
/** Ссылка на политику безопасности */
|
|
558
|
-
pdfPrivacyPolicy?: Maybe<Scalars['String']>;
|
|
559
|
-
pdfExtraDocument?: Maybe<FileData>;
|
|
601
|
+
documents?: Maybe<Array<FinanceDocument>>;
|
|
560
602
|
installmentComment: Scalars['String'];
|
|
561
603
|
currency: Scalars['String'];
|
|
562
604
|
cashPaymentAliases: Array<CashPaymentAlias>;
|
|
@@ -666,9 +708,13 @@ export type MutationAuthClientByPhoneArgs = {
|
|
|
666
708
|
|
|
667
709
|
export type MutationAuthCustomerArgs = {
|
|
668
710
|
orgId: Scalars['Int'];
|
|
669
|
-
phone
|
|
711
|
+
phone?: Maybe<Scalars['String']>;
|
|
670
712
|
smsCode?: Maybe<Scalars['String']>;
|
|
671
713
|
smsToken?: Maybe<Scalars['String']>;
|
|
714
|
+
method?: Maybe<Scalars['String']>;
|
|
715
|
+
login?: Maybe<Scalars['String']>;
|
|
716
|
+
code?: Maybe<Scalars['String']>;
|
|
717
|
+
token?: Maybe<Scalars['String']>;
|
|
672
718
|
};
|
|
673
719
|
|
|
674
720
|
|
|
@@ -709,6 +755,15 @@ export interface OrderCatalogItemMaster {
|
|
|
709
755
|
currency: Scalars['String'];
|
|
710
756
|
}
|
|
711
757
|
|
|
758
|
+
export interface OrderCatalogItemOrg {
|
|
759
|
+
__typename?: 'OrderCatalogItemOrg';
|
|
760
|
+
id: Scalars['ID'];
|
|
761
|
+
uid: Scalars['Int'];
|
|
762
|
+
currency: Scalars['String'];
|
|
763
|
+
contacts: ContactsProfile;
|
|
764
|
+
sendingTransport?: Maybe<SendingTransport>;
|
|
765
|
+
}
|
|
766
|
+
|
|
712
767
|
export interface OrderCatalogItemFragment {
|
|
713
768
|
__typename?: 'OrderCatalogItem_Fragment';
|
|
714
769
|
id: Scalars['ID'];
|
|
@@ -720,6 +775,7 @@ export interface OrderCatalogItemFragment {
|
|
|
720
775
|
unitPrice?: Maybe<Scalars['Float']>;
|
|
721
776
|
/** Старая цена */
|
|
722
777
|
unitPriceOriginal?: Maybe<Scalars['Float']>;
|
|
778
|
+
org?: Maybe<OrderCatalogItemOrg>;
|
|
723
779
|
master?: Maybe<OrderCatalogItemMaster>;
|
|
724
780
|
course?: Maybe<CourseItem>;
|
|
725
781
|
/** Тариф */
|
|
@@ -735,6 +791,7 @@ export interface OrderCatalogItemFragment {
|
|
|
735
791
|
reviews?: Maybe<OrderReviewsConnection>;
|
|
736
792
|
/** Опции с ценами */
|
|
737
793
|
fieldValues?: Maybe<Array<CatalogFieldValue>>;
|
|
794
|
+
partialPayment?: Maybe<PartialPayment>;
|
|
738
795
|
}
|
|
739
796
|
|
|
740
797
|
|
|
@@ -773,6 +830,7 @@ export interface OrderCustom {
|
|
|
773
830
|
/** Суммы поэтапной оплаты */
|
|
774
831
|
partialPrices: Array<PartialPrice>;
|
|
775
832
|
isMultiday?: Maybe<Scalars['Boolean']>;
|
|
833
|
+
contractOfferIds: Array<Scalars['Int']>;
|
|
776
834
|
/** Схема платы заказа */
|
|
777
835
|
usedPartialPayment?: Maybe<UsedPartialPayment>;
|
|
778
836
|
positions: Array<OrderPosition>;
|
|
@@ -791,6 +849,8 @@ export interface OrderPosition {
|
|
|
791
849
|
parentId?: Maybe<Scalars['Int']>;
|
|
792
850
|
sales: Array<SaleOrderPosition>;
|
|
793
851
|
partialPayment: PartialPayment;
|
|
852
|
+
item?: Maybe<CatalogItem>;
|
|
853
|
+
checkoutProducts?: Maybe<Array<CheckoutProduct>>;
|
|
794
854
|
}
|
|
795
855
|
|
|
796
856
|
export interface OrderPositionInput {
|
|
@@ -858,6 +918,8 @@ export interface PartialPayment {
|
|
|
858
918
|
__typename?: 'PartialPayment';
|
|
859
919
|
kind: Scalars['String'];
|
|
860
920
|
complex?: Maybe<Array<PartialPaymentComplexItem>>;
|
|
921
|
+
complexDefaultUid?: Maybe<Scalars['String']>;
|
|
922
|
+
firstPayment?: Maybe<Scalars['BigDecimal']>;
|
|
861
923
|
}
|
|
862
924
|
|
|
863
925
|
export interface PartialPaymentComplexItem {
|
|
@@ -943,14 +1005,18 @@ export interface PublicLandingViewer {
|
|
|
943
1005
|
master: PublicMasterRole;
|
|
944
1006
|
landing?: Maybe<LandingSite>;
|
|
945
1007
|
checkoutPriceDetails?: Maybe<CheckoutPriceDetails>;
|
|
1008
|
+
registerAuthMethod?: Maybe<AuthMethod>;
|
|
1009
|
+
checkoutPositions: Array<CheckoutPosition>;
|
|
946
1010
|
sendingTransport?: Maybe<SendingTransport>;
|
|
947
1011
|
}
|
|
948
1012
|
|
|
949
1013
|
export interface PublicMasterRole {
|
|
950
1014
|
__typename?: 'PublicMasterRole';
|
|
951
1015
|
uid: Scalars['Int'];
|
|
1016
|
+
hasPromoCode: Scalars['Boolean'];
|
|
952
1017
|
master: MasterProfileCustom;
|
|
953
1018
|
contacts: ContactsProfile;
|
|
1019
|
+
sendingTransport?: Maybe<SendingTransport>;
|
|
954
1020
|
/** Ссылка на приложение студента */
|
|
955
1021
|
studentUrl?: Maybe<Scalars['String']>;
|
|
956
1022
|
}
|
|
@@ -1176,6 +1242,7 @@ export interface UpdateLandingOrderInput {
|
|
|
1176
1242
|
locationId?: Maybe<Scalars['Int']>;
|
|
1177
1243
|
address?: Maybe<AddressInput>;
|
|
1178
1244
|
deliveryId?: Maybe<Scalars['Int']>;
|
|
1245
|
+
customParams?: Maybe<Scalars['String']>;
|
|
1179
1246
|
selectedTime?: Maybe<Array<OrderSelectedTimeInput>>;
|
|
1180
1247
|
isMultiday?: Maybe<Scalars['Boolean']>;
|
|
1181
1248
|
clientMutationId?: Maybe<Scalars['String']>;
|
|
@@ -1204,6 +1271,12 @@ export interface UsedPartialPaymentComplex {
|
|
|
1204
1271
|
firstPaymentIndexes?: Maybe<Array<Scalars['Int']>>;
|
|
1205
1272
|
}
|
|
1206
1273
|
|
|
1274
|
+
export interface UserAuth {
|
|
1275
|
+
__typename?: 'UserAuth';
|
|
1276
|
+
method: Scalars['String'];
|
|
1277
|
+
key: Scalars['String'];
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1207
1280
|
export interface UserHuman {
|
|
1208
1281
|
__typename?: 'UserHuman';
|
|
1209
1282
|
id: Scalars['ID'];
|
|
@@ -1220,7 +1293,7 @@ export interface UserProfileCustom {
|
|
|
1220
1293
|
__typename?: 'UserProfileCustom';
|
|
1221
1294
|
id: Scalars['ID'];
|
|
1222
1295
|
uid: Scalars['Int'];
|
|
1223
|
-
|
|
1296
|
+
auths: Array<UserAuth>;
|
|
1224
1297
|
name: Scalars['String'];
|
|
1225
1298
|
shortName: Scalars['String'];
|
|
1226
1299
|
avatarUrl?: Maybe<Scalars['String']>;
|
package/src/utils.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import moment, { Moment } from 'moment'
|
|
2
|
+
type DateTime = Moment | Date | string
|
|
3
|
+
|
|
4
|
+
|
|
1
5
|
export const roundByStep = (v: number, s = 1.0) => {
|
|
2
6
|
const inv = 1.0 / s
|
|
3
7
|
return Math.round(v * inv) / inv
|
|
@@ -27,3 +31,65 @@ export const getCurrencySuffix = (currency: string) => {
|
|
|
27
31
|
return ` ${currency}`
|
|
28
32
|
}
|
|
29
33
|
}
|
|
34
|
+
|
|
35
|
+
export type DateOptionalTimeReplacement = '00:00' | '23:59'
|
|
36
|
+
|
|
37
|
+
export function isNowYear(dateMoment: DateTime | null): boolean {
|
|
38
|
+
if (dateMoment) {
|
|
39
|
+
dateMoment = moment(dateMoment)
|
|
40
|
+
return moment().year() === dateMoment.year()
|
|
41
|
+
} else {
|
|
42
|
+
return false
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Returns date in format like "September 11" or "11 Сентября"
|
|
48
|
+
*/
|
|
49
|
+
export function formatDate(dateMoment: DateTime | null): string {
|
|
50
|
+
if (dateMoment) {
|
|
51
|
+
dateMoment = moment(dateMoment)
|
|
52
|
+
|
|
53
|
+
if (!isNowYear(dateMoment)) {
|
|
54
|
+
return dateMoment.format('D MMMM YYYY')
|
|
55
|
+
} else {
|
|
56
|
+
return dateMoment.format('D MMMM')
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
return ''
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function hasTime(dateMoment: Moment, optionalTimeReplacement: DateOptionalTimeReplacement = '00:00'): boolean {
|
|
64
|
+
if (optionalTimeReplacement == '23:59') {
|
|
65
|
+
return !(dateMoment.hours() === 23 && dateMoment.minutes() === 59)
|
|
66
|
+
} else {
|
|
67
|
+
return (dateMoment.hours() * 60 + dateMoment.minutes()) > 0
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function formatTimeHoursMinutes(dateMoment: DateTime | null): string {
|
|
72
|
+
if (dateMoment) {
|
|
73
|
+
return moment(dateMoment).format('HH:mm')
|
|
74
|
+
} else {
|
|
75
|
+
return ''
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function formatDateOptionalTime(
|
|
80
|
+
dateMoment: DateTime | null,
|
|
81
|
+
separator = ' в ',
|
|
82
|
+
optionalTimeReplacement: DateOptionalTimeReplacement = '00:00',
|
|
83
|
+
): string {
|
|
84
|
+
if (dateMoment) {
|
|
85
|
+
const timestamp = moment(dateMoment)
|
|
86
|
+
|
|
87
|
+
if (hasTime(timestamp, optionalTimeReplacement)) {
|
|
88
|
+
return `${formatDate(timestamp)}${separator}${formatTimeHoursMinutes(timestamp)}`
|
|
89
|
+
} else {
|
|
90
|
+
return formatDate(timestamp)
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
return ''
|
|
94
|
+
}
|
|
95
|
+
}
|