@chaosinsight/postoffice-portalclient 1.13.90 → 1.14.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.
@@ -2,7 +2,7 @@ import type { IOrder, IPost, ISummeryPostStatistics } from "../index";
2
2
  import { Extension, IServiceCall } from "@chaosinsight/portalclient";
3
3
  export default class Deals extends Extension {
4
4
  protected extensionName: string;
5
- get(authorizationToken: string): IServiceCall<void>;
5
+ get(authorizationToken: string): IServiceCall<Array<IPickUpDeal<number>>>;
6
6
  }
7
7
  export declare enum DealState {
8
8
  draft = "draft",
@@ -12,4 +12,5 @@ export var DealState;
12
12
  DealState["active"] = "active";
13
13
  DealState["expired"] = "expired";
14
14
  })(DealState || (DealState = {}));
15
+ Extension.add(Deals, "deals");
15
16
  //# sourceMappingURL=deals.js.map
@@ -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,GAAG,CAAC,kBAA0B;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,EAAE,UAAU,CAAC,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAC3G,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,GAAG,CAAC,kBAA0B;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,EAAE,UAAU,CAAC,GAAG,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAA;IAC3G,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;AA0DD,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA"}
@@ -2,7 +2,7 @@ import { Extension, HttpMethod, SessionRequirement } from "@chaosinsight/portalc
2
2
  export default class Orders extends Extension {
3
3
  extensionName = "Orders";
4
4
  post(authorizationToken, name, email, languageCode, orderLines) {
5
- return this.call(`?authorization_token=${authorizationToken}`, { name, email, languageCode, orderLines }, HttpMethod.PostJson, SessionRequirement.authenticated);
5
+ return this.call(null, { _authorization_token: authorizationToken, name, email, languageCode, orderLines }, HttpMethod.PostJson, SessionRequirement.none);
6
6
  }
7
7
  put(orderId, isCollected) {
8
8
  return this.call(orderId, { isCollected }, HttpMethod.PutJson, SessionRequirement.authenticated);
@@ -1 +1 @@
1
- {"version":3,"file":"orders.js","sourceRoot":"","sources":["../../src/extensions/orders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAgB,kBAAkB,EAAC,MAAM,4BAA4B,CAAA;AAElG,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAS;IAClC,aAAa,GAAW,QAAQ,CAAA;IAEnC,IAAI,CAAC,kBAA0B,EAAE,IAAY,EAAE,KAAa,EAAE,YAAoB,EAA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ED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaosinsight/postoffice-portalclient",
3
- "version": "1.13.90",
3
+ "version": "1.14.0",
4
4
  "license": "UNLICENSED",
5
5
  "private": false,
6
6
  "main": "./src/index.ts",
@@ -20,10 +20,10 @@
20
20
  "url": "https://twitter.com/JacobRichardt"
21
21
  },
22
22
  "peerDependencies": {
23
- "@chaosinsight/portalclient": "^3.10.9"
23
+ "@chaosinsight/portalclient": "^3.11.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@chaosinsight/portalclient": "3.10.9",
26
+ "@chaosinsight/portalclient": "3.11.0",
27
27
  "tslint": "6.1.3",
28
28
  "typescript": "4.4.2"
29
29
  }
@@ -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 get(authorizationToken: string): IServiceCall<void> {
7
+ public get(authorizationToken: string): IServiceCall<Array<IPickUpDeal<number>>> {
8
8
  return this.call(null, {authorization_token: authorizationToken}, HttpMethod.Get, SessionRequirement.none)
9
9
  }
10
10
  }
@@ -72,6 +72,8 @@ export interface IDealReplies {
72
72
  ExceedsStock: string | null
73
73
  }
74
74
 
75
+ Extension.add(Deals, "deals")
76
+
75
77
  declare module "@chaosinsight/portalclient" {
76
78
  // tslint:disable-next-line
77
79
  interface ExtensionHandler {
@@ -4,7 +4,7 @@ export default class Orders extends Extension {
4
4
  protected extensionName: string = "Orders"
5
5
 
6
6
  public post(authorizationToken: string, name: string, email: string, languageCode: string, orderLines: IOrderLine[]): IServiceCall<void> {
7
- return this.call(`?authorization_token=${authorizationToken}`, {name, email, languageCode, orderLines}, HttpMethod.PostJson, SessionRequirement.authenticated)
7
+ return this.call(null, {_authorization_token: authorizationToken, name, email, languageCode, orderLines}, HttpMethod.PostJson, SessionRequirement.none)
8
8
  }
9
9
 
10
10
  public put(orderId: string, isCollected: boolean): IServiceCall<void> {