Skip to content

Commit fd6fae4

Browse files
authored
fix: upgrade Node to the latest on the 18 release line (#72)
* fix: upgrade Node to the latest on the 18 release line * fix: try to resolve NO_PUBKEY error in CI
1 parent aec6e8b commit fd6fae4

File tree

7 files changed

+141
-27
lines changed

7 files changed

+141
-27
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
pocket: pocket/circleci-orbs@2.1.1
4+
pocket: pocket/circleci-orbs@2.2.2
55
backstage-entity-validator: roadiehq/[email protected]
66

77
# Workflow shortcuts
@@ -47,7 +47,7 @@ only_dev: &only_dev
4747
jobs:
4848
build:
4949
docker:
50-
- image: cimg/node:18@sha256:45826c38fb365c2848f3f595443b3086b1df4256d659b380bb9b666141eceadd
50+
- image: cimg/node:18.20
5151
steps:
5252
- checkout
5353
# Define the working directory for this job
@@ -89,7 +89,7 @@ jobs:
8989
description: Run integration tests against external services, e.g. Snowplow
9090
docker:
9191
# The application
92-
- image: cimg/node:18@sha256:45826c38fb365c2848f3f595443b3086b1df4256d659b380bb9b666141eceadd
92+
- image: cimg/node:18.20
9393
auth:
9494
username: $DOCKERHUB_USERNAME
9595
password: $DOCKERHUB_PASSWORD
@@ -127,7 +127,7 @@ jobs:
127127
test_specs:
128128
description: Run spec tests
129129
docker:
130-
- image: cimg/node:18@sha256:45826c38fb365c2848f3f595443b3086b1df4256d659b380bb9b666141eceadd
130+
- image: cimg/node:18.20
131131
auth:
132132
username: $DOCKERHUB_USERNAME
133133
password: $DOCKERHUB_PASSWORD

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.18
1+
18.20

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18-slim@sha256:0a621cdd7d66ad8976f4246ab0661e3b1dd0d397c1dd784ea01bf740bd1c2522
1+
FROM node:18@sha256:332838eb5ed61f24f5f68e3e465453d82ea8cd8870d9875325f20706880ae9fc
22

33
WORKDIR /usr/src/app
44

package-lock.json

Lines changed: 30 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "dist/main.js",
66
"scripts": {
77
"build": "rm -rf dist && tsc",
8-
"codegen": "npm run codegen:graphql-types && npm run codegen:openapi-types",
8+
"codegen": "npm run codegen:graphql-types",
99
"codegen:graphql-types": "graphql-codegen",
1010
"codegen:openapi-types": "npm run lint-openapi && ts-node-esm -P scripts/tsconfig.openapi-typescript.json scripts/generateOpenAPITypes.mts",
1111
"docs": "redocly preview-docs openapi.yml",
@@ -62,7 +62,7 @@
6262
"@types/cookie-parser": "^1.4.3",
6363
"@types/express": "^4.17.14",
6464
"@types/jest": "29.5.12",
65-
"@types/node": "^18.11.9",
65+
"@types/node": "^18.19.31",
6666
"fetch-mock-jest": "1.5.1",
6767
"husky": "8.0.1",
6868
"jest": "29.7.0",
@@ -71,6 +71,6 @@
7171
"openapi-typescript": "^6.0.3",
7272
"supertest": "6.3.3",
7373
"ts-jest": "29.1.2",
74-
"ts-node": "^10.9.1"
74+
"ts-node": "^10.9.2"
7575
}
7676
}

src/generated/graphql/types.ts

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,26 @@ export type ItemHighlights = {
796796
url?: Maybe<Array<Maybe<Scalars['String']>>>;
797797
};
798798

799+
export type ItemNotFound = {
800+
__typename?: 'ItemNotFound';
801+
message?: Maybe<Scalars['String']>;
802+
};
803+
799804
/** Union type for items that may or may not be processed */
800805
export type ItemResult = Item | PendingItem;
801806

807+
export type ItemSummary = {
808+
__typename?: 'ItemSummary';
809+
authors?: Maybe<Array<Author>>;
810+
datePublished?: Maybe<Scalars['ISOString']>;
811+
domain?: Maybe<DomainMetadata>;
812+
excerpt?: Maybe<Scalars['String']>;
813+
image?: Maybe<Image>;
814+
item?: Maybe<Item>;
815+
title?: Maybe<Scalars['String']>;
816+
url: Scalars['Url'];
817+
};
818+
802819
/** A label used to mark and categorize an Entity (e.g. Collection). */
803820
export type Label = {
804821
__typename?: 'Label';
@@ -1709,6 +1726,31 @@ export enum PocketSaveStatus {
17091726
Unread = 'UNREAD'
17101727
}
17111728

1729+
export enum PremiumFeature {
1730+
/** Feature where you get an ad-free experience */
1731+
AdFree = 'AD_FREE',
1732+
/** Feature where you can highlight articles */
1733+
Annotations = 'ANNOTATIONS',
1734+
/** Feature where pocket saves permanent copies of all your saves */
1735+
PermanentLibrary = 'PERMANENT_LIBRARY',
1736+
/** Feature where pocket's search is enhanced */
1737+
PremiumSearch = 'PREMIUM_SEARCH',
1738+
/** Feature where pocket suggests tags */
1739+
SuggestedTags = 'SUGGESTED_TAGS'
1740+
}
1741+
1742+
export enum PremiumStatus {
1743+
/**
1744+
* User has premium and its active
1745+
* 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
1746+
*/
1747+
Active = 'ACTIVE',
1748+
/** User has had premium, but it is expired */
1749+
Expired = 'EXPIRED',
1750+
/** User has never had premium */
1751+
Never = 'NEVER'
1752+
}
1753+
17121754
/** The publisher that the curation team set for the syndicated article */
17131755
export type Publisher = {
17141756
__typename?: 'Publisher';
@@ -1811,6 +1853,14 @@ export type Query = {
18111853
listTopics: Array<Topic>;
18121854
/** Get a slate of ranked recommendations for the Firefox New Tab. Currently supports the Italy, France, and Spain markets. */
18131855
newTabSlate: CorpusSlate;
1856+
/**
1857+
* Resolve Reader View links which might point to SavedItems that do not
1858+
* exist, aren't in the Pocket User's list, or are requested by a logged-out
1859+
* user (or user without a Pocket Account).
1860+
* Fetches data to create an interstitial page/modal so the visitor can click
1861+
* through to the shared site.
1862+
*/
1863+
readerSlug: ReaderViewResult;
18141864
/** List all topics that the user can express a preference for. */
18151865
recommendationPreferenceTopics: Array<Topic>;
18161866
scheduledSurface: ScheduledSurface;
@@ -1953,6 +2003,15 @@ export type QueryNewTabSlateArgs = {
19532003
};
19542004

19552005

2006+
/**
2007+
* Default root level query type. All authorization checks are done in these queries.
2008+
* TODO: These belong in a seperate User Service that provides a User object (the user settings will probably exist there too)
2009+
*/
2010+
export type QueryReaderSlugArgs = {
2011+
slug: Scalars['ID'];
2012+
};
2013+
2014+
19562015
/**
19572016
* Default root level query type. All authorization checks are done in these queries.
19582017
* TODO: These belong in a seperate User Service that provides a User object (the user settings will probably exist there too)
@@ -2007,6 +2066,24 @@ export type QueryUnleashAssignmentsArgs = {
20072066
context: UnleashContext;
20082067
};
20092068

2069+
export type ReaderFallback = ItemNotFound | ReaderInterstitial;
2070+
2071+
export type ReaderInterstitial = {
2072+
__typename?: 'ReaderInterstitial';
2073+
itemCard?: Maybe<ItemSummary>;
2074+
};
2075+
2076+
export type ReaderViewResult = {
2077+
__typename?: 'ReaderViewResult';
2078+
fallbackPage?: Maybe<ReaderFallback>;
2079+
/**
2080+
* The SavedItem referenced by this reader view slug, if it
2081+
* is in the Pocket User's list.
2082+
*/
2083+
savedItem?: Maybe<SavedItem>;
2084+
slug: Scalars['ID'];
2085+
};
2086+
20102087
export type RecItUserProfile = {
20112088
userModels: Array<Scalars['String']>;
20122089
};
@@ -3106,6 +3183,8 @@ export type User = {
31063183
email?: Maybe<Scalars['String']>;
31073184
/** The users first name */
31083185
firstName?: Maybe<Scalars['String']>;
3186+
/** User id, provided by the user service. */
3187+
id: Scalars['ID'];
31093188
/** Indicates if a user is FxA or not */
31103189
isFxa?: Maybe<Scalars['Boolean']>;
31113190
/** The user's premium status */
@@ -3114,6 +3193,10 @@ export type User = {
31143193
lastName?: Maybe<Scalars['String']>;
31153194
/** The users first name and last name combined */
31163195
name?: Maybe<Scalars['String']>;
3196+
/** Premium features that a user has access to */
3197+
premiumFeatures?: Maybe<Array<Maybe<PremiumFeature>>>;
3198+
/** Current premium status of the user */
3199+
premiumStatus?: Maybe<PremiumStatus>;
31173200
/** Preferences for recommendations that the user has explicitly set. */
31183201
recommendationPreferences?: Maybe<UserRecommendationPreferences>;
31193202
/** Get a PocketSave(s) by its id(s) */
@@ -3137,6 +3220,18 @@ export type User = {
31373220
searchSavedItemsByOffset?: Maybe<SavedItemSearchResultPage>;
31383221
/** Get a paginated listing of all a user's Tags */
31393222
tags?: Maybe<TagConnection>;
3223+
/**
3224+
* Get all tag names for a user.
3225+
* If syncSince is passed, it will only return tags if changes
3226+
* to a user's tags have occurred after syncSince. It will return
3227+
* all of the user's tags (not just the changes).
3228+
*
3229+
* Yes, this is bad graphql design. It's serving a specific
3230+
* REST API which has unlimited SQL queries, and we do not want to
3231+
* make it possible to request every associated SavedItem
3232+
* node on a tag object. Just biting the bullet on this one.
3233+
*/
3234+
tagsList?: Maybe<Array<Scalars['String']>>;
31403235
/** The public username for the user */
31413236
username?: Maybe<Scalars['String']>;
31423237
};
@@ -3217,6 +3312,12 @@ export type UserTagsArgs = {
32173312
pagination?: InputMaybe<PaginationInput>;
32183313
};
32193314

3315+
3316+
/** Resolve by reference the User entity in this graph to provide user data with public lists. */
3317+
export type UserTagsListArgs = {
3318+
syncSince?: InputMaybe<Scalars['ISOString']>;
3319+
};
3320+
32203321
export type UserRecommendationPreferences = {
32213322
__typename?: 'UserRecommendationPreferences';
32223323
/** Topics that the user expressed interest in. */

src/graphql-proxy/recommendations/__mocks__/recommendations.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const fakerLocales = {
2828
it: 'it',
2929
};
3030

31-
3231
const fakeRecommendation = (): GraphRecommendation => {
3332
const recommendation: GraphRecommendation = {
3433
__typename: 'CorpusRecommendation',
@@ -51,9 +50,7 @@ const fakeRecommendations = (
5150
): NewTabRecommendationsQuery['newTabSlate']['recommendations'] => {
5251
return Array(count)
5352
.fill(0)
54-
.map((value, index) =>
55-
fakeRecommendation()
56-
);
53+
.map((value, index) => fakeRecommendation());
5754
};
5855

5956
const recommendations = async (

0 commit comments

Comments
 (0)