@chaosinsight/postoffice-portalclient 1.23.13 → 1.24.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/dist/extensions/deals.d.ts +27 -9
- package/dist/extensions/deals.js.map +1 -1
- package/dist/extensions/organizations.d.ts +4 -4
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/extensions/deals.ts +31 -17
- package/src/extensions/organizations.ts +4 -4
- package/src/index.ts +3 -2
|
@@ -2,7 +2,7 @@ import type { IOrder, ISummeryPostStatistics, OptionalNull } from "../index";
|
|
|
2
2
|
import { Extension, IServiceCall } from "@chaosinsight/portalclient";
|
|
3
3
|
export default class Deals extends Extension {
|
|
4
4
|
protected extensionName: string;
|
|
5
|
-
defaultConfigGet(): IServiceCall<
|
|
5
|
+
defaultConfigGet(): IServiceCall<IDefaultDealConfiguration>;
|
|
6
6
|
}
|
|
7
7
|
export declare enum DealState {
|
|
8
8
|
draft = "draft",
|
|
@@ -10,23 +10,41 @@ export declare enum DealState {
|
|
|
10
10
|
active = "active",
|
|
11
11
|
expired = "expired"
|
|
12
12
|
}
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
export type DealTextKeysCommon = "OutOfStockHeader" | "ExpiredHeader" | "AlcoholFooter" | "PleaseTryAgain" | "PickupReminder" | "PickupReminderLastDay";
|
|
14
|
+
export type DealTextKeysRegular = "Footer" | "VariantFooter" | "Confirmation" | "ConfirmationWithLink" | "Expired" | "OutOfStock" | "ExceedsMaxAllowedQuantity" | "ExceedsStock";
|
|
15
|
+
export type DealTextKeysLive = "LiveFooter" | "RobotDisconnectedHeader" | "OrderCheckout" | "Confirmation" | "ConfirmationWithLink" | "RobotConnected" | "ProductSoldOut";
|
|
16
|
+
export interface IDealConfiguration {
|
|
17
|
+
Common: IDealConfigurationSection<DealTextKeysCommon>;
|
|
18
|
+
Regular: IDealConfigurationSection<DealTextKeysRegular>;
|
|
19
|
+
Live: IDealConfigurationSection<DealTextKeysLive>;
|
|
17
20
|
}
|
|
18
|
-
export interface
|
|
21
|
+
export interface IDefaultDealConfiguration {
|
|
22
|
+
Common: IDefaultDealConfigurationSection<DealTextKeysCommon>;
|
|
23
|
+
Regular: IDefaultDealConfigurationSection<DealTextKeysRegular>;
|
|
24
|
+
Live: IDefaultDealConfigurationSection<DealTextKeysLive>;
|
|
25
|
+
}
|
|
26
|
+
export interface IDealConfigurationSection<T extends string> {
|
|
19
27
|
Texts: {
|
|
20
|
-
[key in T]:
|
|
28
|
+
[key in T]: IDealText[];
|
|
21
29
|
};
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
}
|
|
31
|
+
export interface IDefaultDealConfigurationSection<T extends string> {
|
|
32
|
+
Texts: {
|
|
33
|
+
[key in T]: IDealTextAndPlaceholders;
|
|
24
34
|
};
|
|
25
35
|
}
|
|
26
36
|
export interface IDealText {
|
|
27
37
|
Text: string;
|
|
28
38
|
Language: string;
|
|
29
39
|
}
|
|
40
|
+
export interface IDealTextAndPlaceholders {
|
|
41
|
+
Texts: IDealText[];
|
|
42
|
+
Placeholders: IDealPlaceholders;
|
|
43
|
+
}
|
|
44
|
+
export interface IDealPlaceholders {
|
|
45
|
+
Required: string[];
|
|
46
|
+
Optional: string[];
|
|
47
|
+
}
|
|
30
48
|
export interface IDeal<T extends undefined | null = undefined, U extends IProduct<T, null | undefined> = T extends undefined ? IExistingProduct : IProduct<T>> {
|
|
31
49
|
Name: string | null;
|
|
32
50
|
Products: U[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deals.js","sourceRoot":"","sources":["../../src/extensions/deals.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAgB,kBAAkB,EAAC,MAAM,4BAA4B,CAAA;AAElG,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,SAAS;IACjC,aAAa,GAAW,OAAO,CAAA;IAElC,gBAAgB;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,EAAE,UAAU,CAAC,GAAG,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAA;IAC1F,CAAC;CACD;AAED,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACpB,4BAAe,CAAA;IACf,kCAAqB,CAAA;IACrB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;AACpB,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;
|
|
1
|
+
{"version":3,"file":"deals.js","sourceRoot":"","sources":["../../src/extensions/deals.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAgB,kBAAkB,EAAC,MAAM,4BAA4B,CAAA;AAElG,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,SAAS;IACjC,aAAa,GAAW,OAAO,CAAA;IAElC,gBAAgB;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,EAAE,UAAU,CAAC,GAAG,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAA;IAC1F,CAAC;CACD;AAED,MAAM,CAAN,IAAY,SAKX;AALD,WAAY,SAAS;IACpB,4BAAe,CAAA;IACf,kCAAqB,CAAA;IACrB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;AACpB,CAAC,EALW,SAAS,KAAT,SAAS,QAKpB;AAmGD,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA"}
|
|
@@ -53,16 +53,16 @@ export interface IOrganizationReviewConfiguration {
|
|
|
53
53
|
export interface IOrganizationNotificationConfiguration {
|
|
54
54
|
IsEnabled: boolean;
|
|
55
55
|
}
|
|
56
|
-
export interface IOrganizationDealsConfiguration extends IDealConfiguration
|
|
57
|
-
Common: IDealConfiguration
|
|
56
|
+
export interface IOrganizationDealsConfiguration extends IDealConfiguration {
|
|
57
|
+
Common: IDealConfiguration["Common"] & {
|
|
58
58
|
IsAnonymousBuyerEnabled: boolean;
|
|
59
59
|
IsMessagingPrioritized: boolean;
|
|
60
60
|
IsAlcoholEnabled: boolean;
|
|
61
61
|
};
|
|
62
|
-
Regular: IDealConfiguration
|
|
62
|
+
Regular: IDealConfiguration["Regular"] & {
|
|
63
63
|
IsEnabled: boolean;
|
|
64
64
|
};
|
|
65
|
-
Live: IDealConfiguration
|
|
65
|
+
Live: IDealConfiguration["Live"] & {
|
|
66
66
|
IsEnabled: boolean;
|
|
67
67
|
};
|
|
68
68
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { ReportComparePeriod, ReportType } from "./extensions/reportSubscription
|
|
|
24
24
|
export { ServiceConnectionType } from "./extensions/serviceConnections";
|
|
25
25
|
export { FileStatus } from "./iFile";
|
|
26
26
|
export type { IContentGroup, IPrivateContentGroup, IContentGroupContent } from "./extensions/contentGroups";
|
|
27
|
-
export type { IActiveDeal, IDatedDeal, IDeal, IPickUpDeal, IDealConfiguration, IDealConfigurationSection, ISummeryDealPostStatistics, IProduct, ITriggerPhrases, IExistingProduct } from "./extensions/deals";
|
|
27
|
+
export type { IActiveDeal, IDatedDeal, IDeal, IPickUpDeal, IDealConfiguration, IDefaultDealConfiguration, IDealConfigurationSection, IDefaultDealConfigurationSection, IDealText, IDealTextAndPlaceholders, IDealPlaceholders, ISummeryDealPostStatistics, IProduct, ITriggerPhrases, IExistingProduct, DealTextKeysCommon, DealTextKeysRegular, DealTextKeysLive } from "./extensions/deals";
|
|
28
28
|
export type { IFilter } from "./extensions/filters";
|
|
29
29
|
export type { ILocation, ILocationInvitation, ILocationWithServices, ILocationDealConfiguration, ILocationStatisticsConfiguration, ILocationFeatures } from "./extensions/locations";
|
|
30
30
|
export type { IOrder, IOrderLine } from "./extensions/orders";
|
package/package.json
CHANGED
package/src/extensions/deals.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {Extension, HttpMethod, IServiceCall, SessionRequirement} from "@chaosins
|
|
|
4
4
|
export default class Deals extends Extension {
|
|
5
5
|
protected extensionName: string = "Deals"
|
|
6
6
|
|
|
7
|
-
public defaultConfigGet(): IServiceCall<
|
|
7
|
+
public defaultConfigGet(): IServiceCall<IDefaultDealConfiguration> {
|
|
8
8
|
return this.call("DefaultConfig", null, HttpMethod.Get, SessionRequirement.authenticated)
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -16,24 +16,28 @@ export enum DealState {
|
|
|
16
16
|
expired = "expired"
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
export type DealTextKeysCommon = "OutOfStockHeader" | "ExpiredHeader" | "AlcoholFooter" | "PleaseTryAgain" | "PickupReminder" | "PickupReminderLastDay"
|
|
20
|
+
export type DealTextKeysRegular = "Footer" | "VariantFooter" | "Confirmation" | "ConfirmationWithLink" | "Expired" | "OutOfStock" | "ExceedsMaxAllowedQuantity" | "ExceedsStock"
|
|
21
|
+
export type DealTextKeysLive = "LiveFooter" | "RobotDisconnectedHeader" | "OrderCheckout" | "Confirmation" | "ConfirmationWithLink" | "RobotConnected" | "ProductSoldOut"
|
|
22
|
+
|
|
23
|
+
export interface IDealConfiguration {
|
|
24
|
+
Common: IDealConfigurationSection<DealTextKeysCommon>
|
|
25
|
+
Regular: IDealConfigurationSection<DealTextKeysRegular>
|
|
26
|
+
Live: IDealConfigurationSection<DealTextKeysLive>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface IDefaultDealConfiguration {
|
|
30
|
+
Common: IDefaultDealConfigurationSection<DealTextKeysCommon>
|
|
31
|
+
Regular: IDefaultDealConfigurationSection<DealTextKeysRegular>
|
|
32
|
+
Live: IDefaultDealConfigurationSection<DealTextKeysLive>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface IDealConfigurationSection<T extends string> {
|
|
36
|
+
Texts: {[key in T]: IDealText[]}
|
|
32
37
|
}
|
|
33
38
|
|
|
34
|
-
export interface
|
|
35
|
-
Texts: {[key in T]:
|
|
36
|
-
Replies: {[key in U]: IDealText[]}
|
|
39
|
+
export interface IDefaultDealConfigurationSection<T extends string> {
|
|
40
|
+
Texts: {[key in T]: IDealTextAndPlaceholders}
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
export interface IDealText {
|
|
@@ -41,6 +45,16 @@ export interface IDealText {
|
|
|
41
45
|
Language: string
|
|
42
46
|
}
|
|
43
47
|
|
|
48
|
+
export interface IDealTextAndPlaceholders {
|
|
49
|
+
Texts: IDealText[]
|
|
50
|
+
Placeholders: IDealPlaceholders
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface IDealPlaceholders {
|
|
54
|
+
Required: string[]
|
|
55
|
+
Optional: string[]
|
|
56
|
+
}
|
|
57
|
+
|
|
44
58
|
export interface IDeal<
|
|
45
59
|
T extends undefined | null = undefined,
|
|
46
60
|
U extends IProduct<T, null | undefined> = T extends undefined ? IExistingProduct : IProduct<T>> {
|
|
@@ -146,16 +146,16 @@ export interface IOrganizationNotificationConfiguration {
|
|
|
146
146
|
IsEnabled: boolean
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
export interface IOrganizationDealsConfiguration extends IDealConfiguration
|
|
150
|
-
Common: IDealConfiguration
|
|
149
|
+
export interface IOrganizationDealsConfiguration extends IDealConfiguration {
|
|
150
|
+
Common: IDealConfiguration["Common"] & {
|
|
151
151
|
IsAnonymousBuyerEnabled: boolean
|
|
152
152
|
IsMessagingPrioritized: boolean
|
|
153
153
|
IsAlcoholEnabled: boolean
|
|
154
154
|
}
|
|
155
|
-
Regular: IDealConfiguration
|
|
155
|
+
Regular: IDealConfiguration["Regular"] & {
|
|
156
156
|
IsEnabled: boolean
|
|
157
157
|
}
|
|
158
|
-
Live: IDealConfiguration
|
|
158
|
+
Live: IDealConfiguration["Live"] & {
|
|
159
159
|
IsEnabled: boolean
|
|
160
160
|
}
|
|
161
161
|
}
|
package/src/index.ts
CHANGED
|
@@ -27,8 +27,9 @@ export {ServiceConnectionType} from "./extensions/serviceConnections"
|
|
|
27
27
|
export {FileStatus} from "./iFile"
|
|
28
28
|
|
|
29
29
|
export type {IContentGroup, IPrivateContentGroup, IContentGroupContent} from "./extensions/contentGroups"
|
|
30
|
-
export type {IActiveDeal, IDatedDeal, IDeal, IPickUpDeal, IDealConfiguration, IDealConfigurationSection,
|
|
31
|
-
|
|
30
|
+
export type {IActiveDeal, IDatedDeal, IDeal, IPickUpDeal, IDealConfiguration, IDefaultDealConfiguration, IDealConfigurationSection,
|
|
31
|
+
IDefaultDealConfigurationSection, IDealText, IDealTextAndPlaceholders, IDealPlaceholders, ISummeryDealPostStatistics, IProduct,
|
|
32
|
+
ITriggerPhrases, IExistingProduct, DealTextKeysCommon, DealTextKeysRegular, DealTextKeysLive} from "./extensions/deals"
|
|
32
33
|
export type {IFilter} from "./extensions/filters"
|
|
33
34
|
export type {ILocation, ILocationInvitation, ILocationWithServices, ILocationDealConfiguration, ILocationStatisticsConfiguration, ILocationFeatures} from "./extensions/locations"
|
|
34
35
|
export type {IOrder, IOrderLine} from "./extensions/orders"
|