@queue-it/fastly 1.0.4 → 1.1.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/LICENSE +21 -21
- package/README.md +129 -91
- package/assembly/contextProvider.ts +122 -122
- package/assembly/helper.ts +1 -1
- package/assembly/index.ts +3 -3
- package/assembly/requestResponseHandler.ts +137 -137
- package/assembly/sdk/HttpContextProvider.ts +24 -24
- package/assembly/sdk/IntegrationConfig/CustomerIntegrationDecodingHandler.ts +221 -198
- package/assembly/sdk/IntegrationConfig/IntegrationConfigHelpers.ts +232 -232
- package/assembly/sdk/IntegrationConfig/IntegrationConfigModel.ts +93 -93
- package/assembly/sdk/KnownUser.ts +395 -395
- package/assembly/sdk/Models.ts +105 -105
- package/assembly/sdk/QueueITHelpers.ts +263 -263
- package/assembly/sdk/UserInQueueService.ts +245 -245
- package/assembly/sdk/UserInQueueStateCookieRepository.ts +189 -189
- package/assembly/sdk/helpers/Uri.ts +308 -308
- package/assembly/sdk/helpers/crypto.ts +340 -340
- package/package.json +1 -1
package/assembly/sdk/Models.ts
CHANGED
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
import {Utils} from './QueueITHelpers';
|
|
2
|
-
|
|
3
|
-
export class Tuple<T1, T2> {
|
|
4
|
-
first: T1
|
|
5
|
-
second: T2
|
|
6
|
-
|
|
7
|
-
constructor(first: T1, second: T2) {
|
|
8
|
-
this.first = first;
|
|
9
|
-
this.second = second;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export class ValidationResult extends Tuple<RequestValidationResult | null, KnownUserException | null> {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export class QueueEventConfig {
|
|
18
|
-
constructor(
|
|
19
|
-
public eventId: string,
|
|
20
|
-
public layoutName: string,
|
|
21
|
-
public culture: string,
|
|
22
|
-
public queueDomain: string,
|
|
23
|
-
public extendCookieValidity: bool,
|
|
24
|
-
public cookieValidityMinute: i64,
|
|
25
|
-
public cookieDomain: string,
|
|
26
|
-
public version: i64,
|
|
27
|
-
public actionName: string = 'unspecified') {
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
getString(): string {
|
|
31
|
-
return "EventId:" + this.eventId +
|
|
32
|
-
"&Version:" + this.version.toString() +
|
|
33
|
-
"&ActionName:" + this.actionName +
|
|
34
|
-
"&QueueDomain:" + this.queueDomain +
|
|
35
|
-
"&CookieDomain:" + this.cookieDomain +
|
|
36
|
-
"&ExtendCookieValidity:" + this.extendCookieValidity.toString() +
|
|
37
|
-
"&CookieValidityMinute:" + this.cookieValidityMinute.toString() +
|
|
38
|
-
"&LayoutName:" + this.layoutName +
|
|
39
|
-
"&Culture:" + this.culture;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export class CancelEventConfig {
|
|
44
|
-
constructor(public eventId: string,
|
|
45
|
-
public queueDomain: string,
|
|
46
|
-
public cookieDomain: string,
|
|
47
|
-
public version: i64,
|
|
48
|
-
public actionName: string = 'unspecified') {
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
getString(): string {
|
|
52
|
-
return "EventId:" + this.eventId +
|
|
53
|
-
"&Version:" + this.version.toString() +
|
|
54
|
-
"&QueueDomain:" + this.queueDomain +
|
|
55
|
-
"&CookieDomain:" + this.cookieDomain +
|
|
56
|
-
"&ActionName:" + this.actionName;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export class RequestValidationResult {
|
|
61
|
-
constructor(
|
|
62
|
-
public actionType: string,
|
|
63
|
-
public eventId: string,
|
|
64
|
-
public queueId: string,
|
|
65
|
-
public redirectUrl: string,
|
|
66
|
-
public redirectType: string,
|
|
67
|
-
public actionName: string = 'unspecified'
|
|
68
|
-
) {
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
public isAjaxResult: bool;
|
|
72
|
-
|
|
73
|
-
public doRedirect(): bool {
|
|
74
|
-
return this.redirectUrl.length > 0;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
public getAjaxQueueRedirectHeaderKey(): string {
|
|
78
|
-
return "x-queueit-redirect";
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
public getAjaxRedirectUrl(): string {
|
|
82
|
-
if (this.redirectUrl.length > 0) {
|
|
83
|
-
return Utils.encodeUrl(this.redirectUrl);
|
|
84
|
-
}
|
|
85
|
-
return "";
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export class KnownUserException {
|
|
90
|
-
constructor(public message: string) {
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export class ActionTypes {
|
|
95
|
-
public static readonly QueueAction: string = "Queue";
|
|
96
|
-
public static readonly CancelAction: string = "Cancel";
|
|
97
|
-
public static readonly IgnoreAction: string = "Ignore";
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
export class KeyValuePair {
|
|
102
|
-
constructor(public key: string, public value: string) {
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
}
|
|
1
|
+
import {Utils} from './QueueITHelpers';
|
|
2
|
+
|
|
3
|
+
export class Tuple<T1, T2> {
|
|
4
|
+
first: T1
|
|
5
|
+
second: T2
|
|
6
|
+
|
|
7
|
+
constructor(first: T1, second: T2) {
|
|
8
|
+
this.first = first;
|
|
9
|
+
this.second = second;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class ValidationResult extends Tuple<RequestValidationResult | null, KnownUserException | null> {
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class QueueEventConfig {
|
|
18
|
+
constructor(
|
|
19
|
+
public eventId: string,
|
|
20
|
+
public layoutName: string,
|
|
21
|
+
public culture: string,
|
|
22
|
+
public queueDomain: string,
|
|
23
|
+
public extendCookieValidity: bool,
|
|
24
|
+
public cookieValidityMinute: i64,
|
|
25
|
+
public cookieDomain: string,
|
|
26
|
+
public version: i64,
|
|
27
|
+
public actionName: string = 'unspecified') {
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
getString(): string {
|
|
31
|
+
return "EventId:" + this.eventId +
|
|
32
|
+
"&Version:" + this.version.toString() +
|
|
33
|
+
"&ActionName:" + this.actionName +
|
|
34
|
+
"&QueueDomain:" + this.queueDomain +
|
|
35
|
+
"&CookieDomain:" + this.cookieDomain +
|
|
36
|
+
"&ExtendCookieValidity:" + this.extendCookieValidity.toString() +
|
|
37
|
+
"&CookieValidityMinute:" + this.cookieValidityMinute.toString() +
|
|
38
|
+
"&LayoutName:" + this.layoutName +
|
|
39
|
+
"&Culture:" + this.culture;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export class CancelEventConfig {
|
|
44
|
+
constructor(public eventId: string,
|
|
45
|
+
public queueDomain: string,
|
|
46
|
+
public cookieDomain: string,
|
|
47
|
+
public version: i64,
|
|
48
|
+
public actionName: string = 'unspecified') {
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
getString(): string {
|
|
52
|
+
return "EventId:" + this.eventId +
|
|
53
|
+
"&Version:" + this.version.toString() +
|
|
54
|
+
"&QueueDomain:" + this.queueDomain +
|
|
55
|
+
"&CookieDomain:" + this.cookieDomain +
|
|
56
|
+
"&ActionName:" + this.actionName;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export class RequestValidationResult {
|
|
61
|
+
constructor(
|
|
62
|
+
public actionType: string,
|
|
63
|
+
public eventId: string,
|
|
64
|
+
public queueId: string,
|
|
65
|
+
public redirectUrl: string,
|
|
66
|
+
public redirectType: string,
|
|
67
|
+
public actionName: string = 'unspecified'
|
|
68
|
+
) {
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
public isAjaxResult: bool;
|
|
72
|
+
|
|
73
|
+
public doRedirect(): bool {
|
|
74
|
+
return this.redirectUrl.length > 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public getAjaxQueueRedirectHeaderKey(): string {
|
|
78
|
+
return "x-queueit-redirect";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public getAjaxRedirectUrl(): string {
|
|
82
|
+
if (this.redirectUrl.length > 0) {
|
|
83
|
+
return Utils.encodeUrl(this.redirectUrl);
|
|
84
|
+
}
|
|
85
|
+
return "";
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export class KnownUserException {
|
|
90
|
+
constructor(public message: string) {
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export class ActionTypes {
|
|
95
|
+
public static readonly QueueAction: string = "Queue";
|
|
96
|
+
public static readonly CancelAction: string = "Cancel";
|
|
97
|
+
public static readonly IgnoreAction: string = "Ignore";
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
export class KeyValuePair {
|
|
102
|
+
constructor(public key: string, public value: string) {
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
}
|