@chaosinsight/postoffice-portalclient 2.0.2-beta.0 → 2.0.2-beta.2

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.
@@ -0,0 +1,34 @@
1
+ import { IServiceCall } from "@chaosinsight/portalclient";
2
+ import AuthenticationExtension from "./authenticationExtension";
3
+ import { ITokens } from "../index";
4
+ export default class Passkeys extends AuthenticationExtension {
5
+ readonly refreshAuthenticationType = "Passkey";
6
+ protected extensionName: string;
7
+ Assertion(assertion: IPasskeyAssertion): IServiceCall<ITokens>;
8
+ AssertionOptions(): IServiceCall<object>;
9
+ Credential(deviceName: string, credential: IPasskeyCredential): IServiceCall<void>;
10
+ CredentialOptions(password: string): IServiceCall<object>;
11
+ }
12
+ export interface IPasskeyCredential {
13
+ id: string;
14
+ rawId: string;
15
+ response: {
16
+ attestationObject: string;
17
+ clientDataJSON: string;
18
+ };
19
+ }
20
+ export interface IPasskeyAssertion {
21
+ id: string;
22
+ rawId: string;
23
+ response: {
24
+ authenticatorData: string;
25
+ signature: string;
26
+ clientDataJson: string;
27
+ userHandle: string;
28
+ };
29
+ }
30
+ declare module "@chaosinsight/portalclient" {
31
+ interface ExtensionHandler {
32
+ passkeys: Passkeys;
33
+ }
34
+ }
@@ -0,0 +1,20 @@
1
+ import { HttpMethod } from "@chaosinsight/portalclient";
2
+ import AuthenticationExtension from "./authenticationExtension";
3
+ export default class Passkeys extends AuthenticationExtension {
4
+ refreshAuthenticationType = "Passkey";
5
+ extensionName = "Passkeys";
6
+ Assertion(assertion) {
7
+ return this.setTokensFromCall(this.call("Assertion", assertion, HttpMethod.Post), this.refreshAuthenticationType);
8
+ }
9
+ AssertionOptions() {
10
+ return this.call("AssertionOptions", null, HttpMethod.Post);
11
+ }
12
+ Credential(deviceName, credential) {
13
+ return this.call("Credential", { DeviceName: deviceName, Credential: credential }, HttpMethod.Post);
14
+ }
15
+ CredentialOptions(password) {
16
+ return this.call("CredentialOptions", { password }, HttpMethod.Post);
17
+ }
18
+ }
19
+ AuthenticationExtension.add(Passkeys, "passkeys");
20
+ //# sourceMappingURL=passkeys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passkeys.js","sourceRoot":"","sources":["../../src/extensions/passkeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAe,MAAM,4BAA4B,CAAA;AACnE,OAAO,uBAAuB,MAAM,2BAA2B,CAAA;AAG/D,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,uBAAuB;IAC5C,yBAAyB,GAAG,SAAS,CAAA;IAE3C,aAAa,GAAW,UAAU,CAAA;IAErC,SAAS,CAAC,SAA4B;QAC5C,OAAO,IAAI,CAAC,iBAAiB,CAC5B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,EAClD,IAAI,CAAC,yBAAyB,CAC9B,CAAA;IACF,CAAC;IAEM,gBAAgB;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IAC5D,CAAC;IAEM,UAAU,CAAC,UAAkB,EAAE,UAA8B;QACnE,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IAClG,CAAC;IAEM,iBAAiB,CAAC,QAAgB;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAC,QAAQ,EAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAA;IACnE,CAAC;CACD;AAsBD,uBAAuB,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ import "./extensions/liveDeals";
6
6
  import "./extensions/locations";
7
7
  import "./extensions/orders";
8
8
  import "./extensions/organizations";
9
- import "./extensions/passkey";
9
+ import "./extensions/passkeys";
10
10
  import "./extensions/passwords";
11
11
  import "./extensions/posts";
12
12
  import "./extensions/publicDeals";
@@ -34,7 +34,7 @@ export type { IFilter } from "./extensions/filters";
34
34
  export type { ILocation, ILocationInvitation, ILocationWithServices, ILocationDealConfiguration, ILocationStatisticsConfiguration, ILocationFeatures, IPostSuggestion, IExternalLocation } from "./extensions/locations";
35
35
  export type { IOrder, IOrderLine } from "./extensions/orders";
36
36
  export type { IDatedPostStatistics, IOrganization, IOrganizationInvitation, IOrganizationMembership, IOrganizationPermission, IPostStatistics, IDetailedPostStatistics, ISummaryStatistics, ISummeryLocationStatistics, ISummeryPostStatistics, IFeatureFlags, ILocationCreationData, IOrganizationReviewConfiguration, IOrganizationNotificationConfiguration, IOrganizationDealsConfiguration, IOrganizationStatisticsConfiguration, IExternalOrganization } from "./extensions/organizations";
37
- export type { IPasskeyAssertion, IPasskeyCredential } from "./extensions/passkey";
37
+ export type { IPasskeyAssertion, IPasskeyCredential } from "./extensions/passkeys";
38
38
  export type { IDated, IDeleted, IPost, IPostWithStatisticsAndDeal, IPostWithStatisticsAndLocation, IPostFromTemplate, IPostData, IPostingFailure, IPostingSuccess, IPostError, IServicePostError, IPostLocation, IPostTypeData, IPostTypeDataDeal, IPostTypeDataFacebookCarousel, IPostTypeDataFacebookLive, IPostTypeDataFacebookReel, ICarouselItem } from "./extensions/posts";
39
39
  export type { IPublicDeal } from "./extensions/publicDeals";
40
40
  export type { IPublicLocation } from "./extensions/publicLocations";
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import "./extensions/liveDeals";
6
6
  import "./extensions/locations";
7
7
  import "./extensions/orders";
8
8
  import "./extensions/organizations";
9
- import "./extensions/passkey";
9
+ import "./extensions/passkeys";
10
10
  import "./extensions/passwords";
11
11
  import "./extensions/posts";
12
12
  import "./extensions/publicDeals";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"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,iCAAiC,CAAA;AACvK,OAAO,EAAC,qBAAqB,EAAC,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,WAAW,EAAC,MAAM,SAAS,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chaosinsight/postoffice-portalclient",
3
- "version": "2.0.2-beta.0",
3
+ "version": "2.0.2-beta.2",
4
4
  "license": "UNLICENSED",
5
5
  "private": false,
6
6
  "main": "./src/index.ts",
@@ -0,0 +1,57 @@
1
+ import {HttpMethod, IServiceCall} from "@chaosinsight/portalclient"
2
+ import AuthenticationExtension from "./authenticationExtension"
3
+ import {ITokens} from "../index"
4
+
5
+ export default class Passkeys extends AuthenticationExtension {
6
+ public readonly refreshAuthenticationType = "Passkey"
7
+
8
+ protected extensionName: string = "Passkeys"
9
+
10
+ public Assertion(assertion: IPasskeyAssertion): IServiceCall<ITokens> {
11
+ return this.setTokensFromCall(
12
+ this.call("Assertion", assertion, HttpMethod.Post),
13
+ this.refreshAuthenticationType
14
+ )
15
+ }
16
+
17
+ public AssertionOptions(): IServiceCall<object> {
18
+ return this.call("AssertionOptions", null, HttpMethod.Post)
19
+ }
20
+
21
+ public Credential(deviceName: string, credential: IPasskeyCredential): IServiceCall<void> {
22
+ return this.call("Credential", {DeviceName: deviceName, Credential: credential}, HttpMethod.Post)
23
+ }
24
+
25
+ public CredentialOptions(password: string): IServiceCall<object> {
26
+ return this.call("CredentialOptions", {password}, HttpMethod.Post)
27
+ }
28
+ }
29
+
30
+ export interface IPasskeyCredential {
31
+ id: string,
32
+ rawId: string,
33
+ response: {
34
+ attestationObject: string,
35
+ clientDataJSON: string
36
+ }
37
+ }
38
+
39
+ export interface IPasskeyAssertion {
40
+ id: string,
41
+ rawId: string,
42
+ response: {
43
+ authenticatorData: string,
44
+ signature: string,
45
+ clientDataJson: string,
46
+ userHandle: string
47
+ }
48
+ }
49
+
50
+ AuthenticationExtension.add(Passkeys, "passkeys")
51
+
52
+ declare module "@chaosinsight/portalclient" {
53
+ // tslint:disable-next-line
54
+ interface ExtensionHandler {
55
+ passkeys: Passkeys
56
+ }
57
+ }
package/src/index.ts CHANGED
@@ -6,7 +6,7 @@ import "./extensions/liveDeals"
6
6
  import "./extensions/locations"
7
7
  import "./extensions/orders"
8
8
  import "./extensions/organizations"
9
- import "./extensions/passkey"
9
+ import "./extensions/passkeys"
10
10
  import "./extensions/passwords"
11
11
  import "./extensions/posts"
12
12
  import "./extensions/publicDeals"
@@ -37,7 +37,7 @@ export type {IFilter} from "./extensions/filters"
37
37
  export type {ILocation, ILocationInvitation, ILocationWithServices, ILocationDealConfiguration, ILocationStatisticsConfiguration, ILocationFeatures, IPostSuggestion, IExternalLocation} from "./extensions/locations"
38
38
  export type {IOrder, IOrderLine} from "./extensions/orders"
39
39
  export type {IDatedPostStatistics, IOrganization, IOrganizationInvitation, IOrganizationMembership, IOrganizationPermission, IPostStatistics, IDetailedPostStatistics, ISummaryStatistics, ISummeryLocationStatistics, ISummeryPostStatistics, IFeatureFlags, ILocationCreationData, IOrganizationReviewConfiguration, IOrganizationNotificationConfiguration, IOrganizationDealsConfiguration, IOrganizationStatisticsConfiguration, IExternalOrganization} from "./extensions/organizations"
40
- export type {IPasskeyAssertion, IPasskeyCredential} from "./extensions/passkey"
40
+ export type {IPasskeyAssertion, IPasskeyCredential} from "./extensions/passkeys"
41
41
  export type {IDated, IDeleted, IPost, IPostWithStatisticsAndDeal, IPostWithStatisticsAndLocation, IPostFromTemplate, IPostData, IPostingFailure, IPostingSuccess, IPostError, IServicePostError, IPostLocation, IPostTypeData, IPostTypeDataDeal, IPostTypeDataFacebookCarousel, IPostTypeDataFacebookLive, IPostTypeDataFacebookReel, ICarouselItem} from "./extensions/posts"
42
42
  export type {IPublicDeal} from "./extensions/publicDeals"
43
43
  export type {IPublicLocation} from "./extensions/publicLocations"
@@ -1,57 +0,0 @@
1
- import {HttpMethod, IServiceCall} from "@chaosinsight/portalclient"
2
- import AuthenticationExtension from "./authenticationExtension"
3
- import {ITokens} from "../index"
4
-
5
- export default class Passkey extends AuthenticationExtension {
6
- public readonly refreshAuthenticationType = "Passkey"
7
-
8
- protected extensionName: string = "Passkey"
9
-
10
- public Assertion(assertion: IPasskeyAssertion): IServiceCall<ITokens> {
11
- return this.setTokensFromCall(
12
- this.call("Assertion", assertion, HttpMethod.Post),
13
- this.refreshAuthenticationType
14
- )
15
- }
16
-
17
- public AssertionOptions(): IServiceCall<string> {
18
- return this.call("AssertionOptions", null, HttpMethod.Post)
19
- }
20
-
21
- public Credentials(deviceName: string, credential: IPasskeyCredential): IServiceCall<void> {
22
- return this.call("Credentials", {DeviceName: deviceName, Credential: credential}, HttpMethod.Post)
23
- }
24
-
25
- public CredentialsOptions(password: string): IServiceCall<string> {
26
- return this.call("CredentialsOptions", {password}, HttpMethod.Post)
27
- }
28
- }
29
-
30
- export interface IPasskeyCredential {
31
- Id: string,
32
- RawId: string,
33
- Response: {
34
- AttestationObject: string,
35
- ClientDataJSON: string
36
- }
37
- }
38
-
39
- export interface IPasskeyAssertion {
40
- Id: string,
41
- RawId: string,
42
- Response: {
43
- AuthenticatorData: string,
44
- Signature: string,
45
- ClientDataJson: string,
46
- UserHandle: string
47
- }
48
- }
49
-
50
- AuthenticationExtension.add(Passkey, "passkey")
51
-
52
- declare module "@chaosinsight/portalclient" {
53
- // tslint:disable-next-line
54
- interface ExtensionHandler {
55
- passkey: Passkey
56
- }
57
- }