Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
pocket: pocket/circleci-orbs@2.1.1
pocket: pocket/circleci-orbs@2.2.2
backstage-entity-validator: roadiehq/backstage-entity-validator@0.4.2

# Workflow shortcuts
Expand Down Expand Up @@ -47,7 +47,7 @@ only_dev: &only_dev
jobs:
build:
docker:
- image: cimg/node:18@sha256:45826c38fb365c2848f3f595443b3086b1df4256d659b380bb9b666141eceadd
- image: cimg/node:18.20
steps:
- checkout
# Define the working directory for this job
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
description: Run integration tests against external services, e.g. Snowplow
docker:
# The application
- image: cimg/node:18@sha256:45826c38fb365c2848f3f595443b3086b1df4256d659b380bb9b666141eceadd
- image: cimg/node:18.20
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
test_specs:
description: Run spec tests
docker:
- image: cimg/node:18@sha256:45826c38fb365c2848f3f595443b3086b1df4256d659b380bb9b666141eceadd
- image: cimg/node:18.20
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change fixed the NO_PUBKEY errors in CI.

auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.18
18.20
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-slim@sha256:0a621cdd7d66ad8976f4246ab0661e3b1dd0d397c1dd784ea01bf740bd1c2522
FROM node:18@sha256:332838eb5ed61f24f5f68e3e465453d82ea8cd8870d9875325f20706880ae9fc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node docs:

Unless you are working in an environment where only the node image will be deployed and you have space constraints, we highly recommend using the default image of this repository.


WORKDIR /usr/src/app

Expand Down
44 changes: 30 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "dist/main.js",
"scripts": {
"build": "rm -rf dist && tsc",
"codegen": "npm run codegen:graphql-types && npm run codegen:openapi-types",
"codegen": "npm run codegen:graphql-types",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a combined job to run both scripts not needed any more? I think it's used by a pre-commit hook

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to add an item under 'additional changes':

pre-commit failed on the OpenAPI validation, so I disabled that. I created MC-952 in the maintenance backlog to turn this back on.

"codegen:graphql-types": "graphql-codegen",
"codegen:openapi-types": "npm run lint-openapi && ts-node-esm -P scripts/tsconfig.openapi-typescript.json scripts/generateOpenAPITypes.mts",
"docs": "redocly preview-docs openapi.yml",
Expand Down Expand Up @@ -62,7 +62,7 @@
"@types/cookie-parser": "^1.4.3",
"@types/express": "^4.17.14",
"@types/jest": "29.5.12",
"@types/node": "^18.11.9",
"@types/node": "^18.19.31",
"fetch-mock-jest": "1.5.1",
"husky": "8.0.1",
"jest": "29.7.0",
Expand All @@ -71,6 +71,6 @@
"openapi-typescript": "^6.0.3",
"supertest": "6.3.3",
"ts-jest": "29.1.2",
"ts-node": "^10.9.1"
"ts-node": "^10.9.2"
}
}
101 changes: 101 additions & 0 deletions src/generated/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -796,9 +796,26 @@ export type ItemHighlights = {
url?: Maybe<Array<Maybe<Scalars['String']>>>;
};

export type ItemNotFound = {
__typename?: 'ItemNotFound';
message?: Maybe<Scalars['String']>;
};

/** Union type for items that may or may not be processed */
export type ItemResult = Item | PendingItem;

export type ItemSummary = {
__typename?: 'ItemSummary';
authors?: Maybe<Array<Author>>;
datePublished?: Maybe<Scalars['ISOString']>;
domain?: Maybe<DomainMetadata>;
excerpt?: Maybe<Scalars['String']>;
image?: Maybe<Image>;
item?: Maybe<Item>;
title?: Maybe<Scalars['String']>;
url: Scalars['Url'];
};

/** A label used to mark and categorize an Entity (e.g. Collection). */
export type Label = {
__typename?: 'Label';
Expand Down Expand Up @@ -1709,6 +1726,31 @@ export enum PocketSaveStatus {
Unread = 'UNREAD'
}

export enum PremiumFeature {
/** Feature where you get an ad-free experience */
AdFree = 'AD_FREE',
/** Feature where you can highlight articles */
Annotations = 'ANNOTATIONS',
/** Feature where pocket saves permanent copies of all your saves */
PermanentLibrary = 'PERMANENT_LIBRARY',
/** Feature where pocket's search is enhanced */
PremiumSearch = 'PREMIUM_SEARCH',
/** Feature where pocket suggests tags */
SuggestedTags = 'SUGGESTED_TAGS'
}

export enum PremiumStatus {
/**
* User has premium and its active
* NOTE: User will still show as active if they turn off auto-renew or have otherwise canceled but the expiration date hasn't hit yet
*/
Active = 'ACTIVE',
/** User has had premium, but it is expired */
Expired = 'EXPIRED',
/** User has never had premium */
Never = 'NEVER'
}

/** The publisher that the curation team set for the syndicated article */
export type Publisher = {
__typename?: 'Publisher';
Expand Down Expand Up @@ -1811,6 +1853,14 @@ export type Query = {
listTopics: Array<Topic>;
/** Get a slate of ranked recommendations for the Firefox New Tab. Currently supports the Italy, France, and Spain markets. */
newTabSlate: CorpusSlate;
/**
* Resolve Reader View links which might point to SavedItems that do not
* exist, aren't in the Pocket User's list, or are requested by a logged-out
* user (or user without a Pocket Account).
* Fetches data to create an interstitial page/modal so the visitor can click
* through to the shared site.
*/
readerSlug: ReaderViewResult;
/** List all topics that the user can express a preference for. */
recommendationPreferenceTopics: Array<Topic>;
scheduledSurface: ScheduledSurface;
Expand Down Expand Up @@ -1953,6 +2003,15 @@ export type QueryNewTabSlateArgs = {
};


/**
* Default root level query type. All authorization checks are done in these queries.
* TODO: These belong in a seperate User Service that provides a User object (the user settings will probably exist there too)
*/
export type QueryReaderSlugArgs = {
slug: Scalars['ID'];
};


/**
* Default root level query type. All authorization checks are done in these queries.
* TODO: These belong in a seperate User Service that provides a User object (the user settings will probably exist there too)
Expand Down Expand Up @@ -2007,6 +2066,24 @@ export type QueryUnleashAssignmentsArgs = {
context: UnleashContext;
};

export type ReaderFallback = ItemNotFound | ReaderInterstitial;

export type ReaderInterstitial = {
__typename?: 'ReaderInterstitial';
itemCard?: Maybe<ItemSummary>;
};

export type ReaderViewResult = {
__typename?: 'ReaderViewResult';
fallbackPage?: Maybe<ReaderFallback>;
/**
* The SavedItem referenced by this reader view slug, if it
* is in the Pocket User's list.
*/
savedItem?: Maybe<SavedItem>;
slug: Scalars['ID'];
};

export type RecItUserProfile = {
userModels: Array<Scalars['String']>;
};
Expand Down Expand Up @@ -3106,6 +3183,8 @@ export type User = {
email?: Maybe<Scalars['String']>;
/** The users first name */
firstName?: Maybe<Scalars['String']>;
/** User id, provided by the user service. */
id: Scalars['ID'];
/** Indicates if a user is FxA or not */
isFxa?: Maybe<Scalars['Boolean']>;
/** The user's premium status */
Expand All @@ -3114,6 +3193,10 @@ export type User = {
lastName?: Maybe<Scalars['String']>;
/** The users first name and last name combined */
name?: Maybe<Scalars['String']>;
/** Premium features that a user has access to */
premiumFeatures?: Maybe<Array<Maybe<PremiumFeature>>>;
/** Current premium status of the user */
premiumStatus?: Maybe<PremiumStatus>;
/** Preferences for recommendations that the user has explicitly set. */
recommendationPreferences?: Maybe<UserRecommendationPreferences>;
/** Get a PocketSave(s) by its id(s) */
Expand All @@ -3137,6 +3220,18 @@ export type User = {
searchSavedItemsByOffset?: Maybe<SavedItemSearchResultPage>;
/** Get a paginated listing of all a user's Tags */
tags?: Maybe<TagConnection>;
/**
* Get all tag names for a user.
* If syncSince is passed, it will only return tags if changes
* to a user's tags have occurred after syncSince. It will return
* all of the user's tags (not just the changes).
*
* Yes, this is bad graphql design. It's serving a specific
* REST API which has unlimited SQL queries, and we do not want to
* make it possible to request every associated SavedItem
* node on a tag object. Just biting the bullet on this one.
*/
tagsList?: Maybe<Array<Scalars['String']>>;
/** The public username for the user */
username?: Maybe<Scalars['String']>;
};
Expand Down Expand Up @@ -3217,6 +3312,12 @@ export type UserTagsArgs = {
pagination?: InputMaybe<PaginationInput>;
};


/** Resolve by reference the User entity in this graph to provide user data with public lists. */
export type UserTagsListArgs = {
syncSince?: InputMaybe<Scalars['ISOString']>;
};

export type UserRecommendationPreferences = {
__typename?: 'UserRecommendationPreferences';
/** Topics that the user expressed interest in. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const fakerLocales = {
it: 'it',
};


const fakeRecommendation = (): GraphRecommendation => {
const recommendation: GraphRecommendation = {
__typename: 'CorpusRecommendation',
Expand All @@ -51,9 +50,7 @@ const fakeRecommendations = (
): NewTabRecommendationsQuery['newTabSlate']['recommendations'] => {
return Array(count)
.fill(0)
.map((value, index) =>
fakeRecommendation()
);
.map((value, index) => fakeRecommendation());
};

const recommendations = async (
Expand Down