Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@artsy/cohesion

Package Overview
Dependencies
Maintainers
14
Versions
455
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@artsy/cohesion - npm Package Compare versions

Comparing version 1.34.0 to 1.34.1-canary.101.1510.0

dist/Helpers/SavesAndFollows/__tests__/Follow/Artist.test.d.ts

66

dist/Helpers/SavesAndFollows/Follow.d.ts

@@ -1,2 +0,2 @@

import { AuthContextModule, FollowedArtist, FollowedGene, OwnerType, UnfollowedArtist, UnfollowedGene } from "../../Schema";
import { AuthContextModule, FollowedArtist, FollowedFair, FollowedGene, FollowedPartner, OwnerType, UnfollowedArtist, UnfollowedFair, UnfollowedGene, UnfollowedPartner } from "../../Schema";
export interface FollowedArgs {

@@ -43,2 +43,34 @@ contextModule: AuthContextModule;

/**
* A user follows a fair
*
* @example
* ```
* followedFair({
* contextModule: ContextModule.otherWorksFromPartnerRail,
* contextOwnerId: "5359794d2a1e86c3741001f8",
* contextOwnerSlug: "andy-warhol-skull",
* contextOwnerType: OwnerType.artwork,
* ownerId: "5359794d1a1e86c3740001f7",
* ownerSlug: "frieze-london",
* })
* ```
*/
export declare const followedFair: (args: FollowedArgs) => FollowedFair;
/**
* A user unfollows a fair
*
* @example
* ```
* unfollowedFair({
* contextModule: ContextModule.otherWorksFromPartnerRail,
* contextOwnerId: "5359794d2a1e86c3741001f8",
* contextOwnerSlug: "andy-warhol-skull",
* contextOwnerType: OwnerType.artwork,
* ownerId: "5359794d1a1e86c3740001f7",
* ownerSlug: "frieze-london",
* })
* ```
*/
export declare const unfollowedFair: (args: FollowedArgs) => UnfollowedFair;
/**
* A user follows a gene

@@ -75,1 +107,33 @@ *

export declare const unfollowedGene: (args: FollowedArgs) => UnfollowedGene;
/**
* A user follows a partner
*
* @example
* ```
* followedPartner({
* contextModule: ContextModule.aboutTheWork,
* contextOwnerId: "5359794d2a1e86c3741001f8",
* contextOwnerSlug: "andy-warhol-skull",
* contextOwnerType: OwnerType.artwork,
* ownerId: "5359794d1a1e86c3740001f7",
* ownerSlug: "pace-prints",
* })
* ```
*/
export declare const followedPartner: (args: FollowedArgs) => FollowedPartner;
/**
* A user unfollows a partner
*
* @example
* ```
* unfollowedPartner({
* contextModule: ContextModule.aboutTheWork,
* contextOwnerId: "5359794d2a1e86c3741001f8",
* contextOwnerSlug: "andy-warhol-skull",
* contextOwnerType: OwnerType.artwork,
* ownerId: "5359794d1a1e86c3740001f7",
* ownerSlug: "pace-prints",
* })
* ```
*/
export declare const unfollowedPartner: (args: FollowedArgs) => UnfollowedPartner;

@@ -6,3 +6,3 @@ "use strict";

});
exports.unfollowedGene = exports.followedGene = exports.unfollowedArtist = exports.followedArtist = void 0;
exports.unfollowedPartner = exports.followedPartner = exports.unfollowedGene = exports.followedGene = exports.unfollowedFair = exports.followedFair = exports.unfollowedArtist = exports.followedArtist = void 0;

@@ -52,2 +52,46 @@ var _Schema = require("../../Schema");

/**
* A user follows a fair
*
* @example
* ```
* followedFair({
* contextModule: ContextModule.otherWorksFromPartnerRail,
* contextOwnerId: "5359794d2a1e86c3741001f8",
* contextOwnerSlug: "andy-warhol-skull",
* contextOwnerType: OwnerType.artwork,
* ownerId: "5359794d1a1e86c3740001f7",
* ownerSlug: "frieze-london",
* })
* ```
*/
exports.unfollowedArtist = unfollowedArtist;
const followedFair = args => {
return follow(args, _Schema.OwnerType.fair);
};
/**
* A user unfollows a fair
*
* @example
* ```
* unfollowedFair({
* contextModule: ContextModule.otherWorksFromPartnerRail,
* contextOwnerId: "5359794d2a1e86c3741001f8",
* contextOwnerSlug: "andy-warhol-skull",
* contextOwnerType: OwnerType.artwork,
* ownerId: "5359794d1a1e86c3740001f7",
* ownerSlug: "frieze-london",
* })
* ```
*/
exports.followedFair = followedFair;
const unfollowedFair = args => {
return follow(args, _Schema.OwnerType.fair, true);
};
/**
* A user follows a gene

@@ -69,3 +113,3 @@ *

exports.unfollowedArtist = unfollowedArtist;
exports.unfollowedFair = unfollowedFair;

@@ -97,5 +141,49 @@ const followedGene = args => {

};
/**
* A user follows a partner
*
* @example
* ```
* followedPartner({
* contextModule: ContextModule.aboutTheWork,
* contextOwnerId: "5359794d2a1e86c3741001f8",
* contextOwnerSlug: "andy-warhol-skull",
* contextOwnerType: OwnerType.artwork,
* ownerId: "5359794d1a1e86c3740001f7",
* ownerSlug: "pace-prints",
* })
* ```
*/
exports.unfollowedGene = unfollowedGene;
const followedPartner = args => {
return follow(args, _Schema.OwnerType.partner);
};
/**
* A user unfollows a partner
*
* @example
* ```
* unfollowedPartner({
* contextModule: ContextModule.aboutTheWork,
* contextOwnerId: "5359794d2a1e86c3741001f8",
* contextOwnerSlug: "andy-warhol-skull",
* contextOwnerType: OwnerType.artwork,
* ownerId: "5359794d1a1e86c3740001f7",
* ownerSlug: "pace-prints",
* })
* ```
*/
exports.followedPartner = followedPartner;
const unfollowedPartner = args => {
return follow(args, _Schema.OwnerType.partner, true);
};
exports.unfollowedPartner = unfollowedPartner;
const follow = ({

@@ -118,6 +206,18 @@ contextModule,

case _Schema.OwnerType.fair:
{
action = isUnfollow ? _Schema.ActionType.unfollowedFair : _Schema.ActionType.followedFair;
break;
}
case _Schema.OwnerType.gene:
{
action = isUnfollow ? _Schema.ActionType.unfollowedGene : _Schema.ActionType.followedGene;
break;
}
case _Schema.OwnerType.partner:
{
action = isUnfollow ? _Schema.ActionType.unfollowedPartner : _Schema.ActionType.followedPartner;
}
}

@@ -124,0 +224,0 @@

import { AuthImpression, CreatedAccount, ResetYourPassword, SuccessfullyLoggedIn } from "./Authentication";
import { ClickedArtistGroup, ClickedArtistSeriesGroup, ClickedArtworkGroup, ClickedAuctionGroup, ClickedCollectionGroup, ClickedFairGroup, ClickedMainArtworkGrid } from "./Click";
import { FocusedOnConversationMessageInput, SentConversationMessage } from "./Conversations";
import { FollowedArtist, FollowedGene, UnfollowedArtist, UnfollowedGene } from "./SavesAndFollows";
import { TappedArtistGroup, TappedArtistSeriesGroup, TappedArtworkGroup, TappedAuctionGroup, TappedCollectionGroup, TappedConsign, TappedExploreGroup, TappedFairGroup, TappedMainArtworkGrid, TappedPromoSpace, TappedTabBar, TappedViewingRoomGroup } from "./Tap";
import { FollowEvents } from "./SavesAndFollows";
import { TimeOnPage } from "./System";

@@ -12,3 +12,3 @@ /**

*/
export declare type Event = AuthImpression | CreatedAccount | ClickedArtistGroup | ClickedArtistSeriesGroup | ClickedArtworkGroup | ClickedAuctionGroup | ClickedCollectionGroup | ClickedFairGroup | ClickedMainArtworkGrid | FocusedOnConversationMessageInput | FollowedArtist | FollowedGene | ResetYourPassword | SentConversationMessage | SuccessfullyLoggedIn | TappedArtistGroup | TappedArtistSeriesGroup | TappedArtworkGroup | TappedAuctionGroup | TappedCollectionGroup | TappedExploreGroup | TappedFairGroup | TappedConsign | TappedMainArtworkGrid | TappedPromoSpace | TappedTabBar | TappedViewingRoomGroup | TimeOnPage | UnfollowedArtist | UnfollowedGene;
export declare type Event = AuthImpression | CreatedAccount | ClickedArtistGroup | ClickedArtistSeriesGroup | ClickedArtworkGroup | ClickedAuctionGroup | ClickedCollectionGroup | ClickedFairGroup | ClickedMainArtworkGrid | FocusedOnConversationMessageInput | FollowEvents | ResetYourPassword | SentConversationMessage | SuccessfullyLoggedIn | TappedArtistGroup | TappedArtistSeriesGroup | TappedArtworkGroup | TappedAuctionGroup | TappedCollectionGroup | TappedExploreGroup | TappedFairGroup | TappedConsign | TappedMainArtworkGrid | TappedPromoSpace | TappedTabBar | TappedViewingRoomGroup | TimeOnPage;
/**

@@ -65,2 +65,6 @@ * The top-level actions an Event describes.

/**
* Corresponds to {@link FollowedFair}
*/
followedFair = "followedFair",
/**
* Corresponds to {@link FollowedGene}

@@ -70,2 +74,6 @@ */

/**
* Corresponds to {@link FollowedPartner}
*/
followedPartner = "followedPartner",
/**
* Corresponds to {@link ResetYourPassword}

@@ -139,5 +147,13 @@ */

/**
* Corresponds to {@link UnfollowedArtist}
* Corresponds to {@link UnfollowedFair}
*/
unfollowedGene = "unfollowedGene"
unfollowedFair = "unfollowedFair",
/**
* Corresponds to {@link UnfollowedGene}
*/
unfollowedGene = "unfollowedGene",
/**
* Corresponds to {@link UnfollowedPartner}
*/
unfollowedPartner = "unfollowedPartner"
}

@@ -34,3 +34,5 @@ "use strict";

ActionType["followedArtist"] = "followedArtist";
ActionType["followedFair"] = "followedFair";
ActionType["followedGene"] = "followedGene";
ActionType["followedPartner"] = "followedPartner";
ActionType["resetYourPassword"] = "resetYourPassword";

@@ -53,3 +55,5 @@ ActionType["successfullyLoggedIn"] = "successfullyLoggedIn";

ActionType["unfollowedArtist"] = "unfollowedArtist";
ActionType["unfollowedFair"] = "unfollowedFair";
ActionType["unfollowedGene"] = "unfollowedGene";
ActionType["unfollowedPartner"] = "unfollowedPartner";
})(ActionType || (exports.ActionType = ActionType = {}));

@@ -8,2 +8,4 @@ import { ActionType } from ".";

*/
export declare type FollowableEntity = OwnerType.artist | OwnerType.fair | OwnerType.gene | OwnerType.partner;
export declare type FollowEvents = FollowedArtist | UnfollowedArtist | FollowedFair | UnfollowedFair | FollowedGene | UnfollowedGene | FollowedPartner | UnfollowedPartner;
export interface FollowedEntity {

@@ -16,3 +18,3 @@ context_module: AuthContextModule;

owner_slug: string;
owner_type: OwnerType.artist | OwnerType.gene;
owner_type: FollowableEntity;
}

@@ -42,2 +44,24 @@ /**

/**
* A user has followed a fair.
*
* This schema describes events sent to Segment from [[followedFair]]
*
* @example
* ```
* {
* action: "followedFair",
* context_module: "otherWorksFromPartnerRail"
* context_owner_id: "5359794d1a1e86c3740001f8"
* context_owner_slug: "andy-warhol-skull"
* context_owner_type: "artwork"
* owner_id: "5359794d1a1e86c3740001f7"
* owner_slug: "frieze-london"
* owner_type: "fair"
* }
* ```
*/
export interface FollowedFair extends FollowedEntity {
action: ActionType.followedFair;
}
/**
* A user has followed a gene.

@@ -65,2 +89,24 @@ *

/**
* A user has followed a partner.
*
* This schema describes events sent to Segment from [[followedPartner]]
*
* @example
* ```
* {
* action: "followedPartner",
* context_module: "aboutTheWork"
* context_owner_id: "5359794d1a1e86c3740001f7"
* context_owner_slug: "andy-warhol-skull"
* context_owner_type: "artwork"
* owner_id: "5359794d1a1e86c3740001f7"
* owner_slug: "pace-prints"
* owner_type: "partner"
* }
* ```
*/
export interface FollowedPartner extends FollowedEntity {
action: ActionType.followedPartner;
}
/**
* A user has unfollowed an artist.

@@ -88,2 +134,24 @@ *

/**
* A user has unfollowed a fair.
*
* This schema describes events sent to Segment from [[unfollowedFair]]
*
* @example
* ```
* {
* action: "unfollowedFair",
* context_module: "otherWorksFromPartnerRail"
* context_owner_id: "5359794d1a1e86c3740001f8"
* context_owner_slug: "andy-warhol-skull"
* context_owner_type: "artwork"
* owner_id: "5359794d1a1e86c3740001f7"
* owner_slug: "frieze-london"
* owner_type: "fair"
* }
* ```
*/
export interface UnfollowedFair extends FollowedEntity {
action: ActionType.unfollowedFair;
}
/**
* A user has unfollowed a gene.

@@ -110,1 +178,23 @@ *

}
/**
* A user has unfollowed a partner.
*
* This schema describes events sent to Segment from [[unfollowedPartner]]
*
* @example
* ```
* {
* action: "unfollowedPartner",
* context_module: "aboutTheWork"
* context_owner_id: "5359794d1a1e86c3740001f7"
* context_owner_slug: "andy-warhol-skull"
* context_owner_type: "artwork"
* owner_id: "5359794d1a1e86c3740001f7"
* owner_slug: "pace-prints"
* owner_type: "partner"
* }
* ```
*/
export interface UnfollowedPartner extends FollowedEntity {
action: ActionType.unfollowedPartner;
}

@@ -25,2 +25,3 @@ /**

fair = "fair",
fairs = "fairs",
galleries = "galleries",

@@ -27,0 +28,0 @@ home = "home",

@@ -39,2 +39,3 @@ "use strict";

OwnerType["fair"] = "fair";
OwnerType["fairs"] = "fairs";
OwnerType["galleries"] = "galleries";

@@ -41,0 +42,0 @@ OwnerType["home"] = "home";

2

package.json
{
"name": "@artsy/cohesion",
"version": "1.34.0",
"version": "1.34.1-canary.101.1510.0",
"description": "Analytics schema and library helpers",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc