diff --git a/lib/types/entities.ts b/lib/types/entities.ts index aa1d1a23c6..a3df583967 100644 --- a/lib/types/entities.ts +++ b/lib/types/entities.ts @@ -1,223 +1,17 @@ -import { ContentEntitySys, ContentEntityType, Items, Link, Metadata } from './utils' - -export type TagVisibility = 'private' | 'public' - -export interface User { - /** - * System metadata - */ - sys: { - type: string - id: string - version: number - createdBy?: Link - createdAt: string - updatedBy?: Link - updatedAt: string - } - /** - * First name of the user - */ - firstName: string - /** - * Last name of the user - */ - lastName: string - /** - * Url to the users avatar - */ - avatarUrl: string - /** - * Email address of the user - */ - email: string - /** - * Activation flag - */ - activated: boolean - /** - * Number of sign ins - */ - signInCount: number - /** - * User confirmation flag - */ - confirmed: boolean - '2faEnabled': boolean - cookieConsentData: string -} - -export interface Tag { - sys: { - type: 'Tag' - id: string - space: Link - environment: Link - createdBy?: Link - updatedBy?: Link - createdAt: string - updatedAt: string - version: number - visibility: TagVisibility - } - name: string -} - -export interface Asset { - sys: ContentEntitySys - fields: { - /** Title for this asset */ - title: { - [key: string]: string - } - /** Description for this asset */ - description?: { - [key: string]: string - } - /** File object for this asset */ - file: { - [key: string]: { - fileName: string - contentType: string - /** Url where the file is available to be downloaded from, into the Contentful asset system. After the asset is processed this field is gone. */ - upload?: string - /** Url where the file is available at the Contentful media asset system. This field won't be available until the asset is processed. */ - url?: string - /** Details for the file, depending on file type (example: image size in bytes, etc) */ - details?: Record - uploadFrom?: Record - } - } - } - metadata?: Metadata -} - -type TaskStatus = 'active' | 'resolved' - -interface TaskSys { - id: string - type: 'Task' - parentEntity: { sys: Link } - space: Link - environment: Link - createdBy: Link - createdAt: string - updatedBy: Link - updatedAt: string - version: number -} - -export interface Task { - assignedTo: Link - body: string - status: TaskStatus - sys: TaskSys -} - -export enum ScheduledActionStatuses { - scheduled = 'scheduled', - inProgress = 'inProgress', - succeeded = 'succeeded', - failed = 'failed', - canceled = 'canceled', -} -// WARNING: This is using 'keyof' which looks at the left hand name, not the right hand value -type PublicActionStatus = keyof typeof ScheduledActionStatuses -type ScheduledActionActionType = 'publish' | 'unpublish' - -export interface ScheduledAction { - sys: { - id: string - type: 'ScheduledAction' - /** ISO 8601 string */ - createdAt: string - createdBy: Link - /** ISO 8601 string */ - canceledAt?: string - canceledBy?: Link - space: Link - status: PublicActionStatus - } - entity: { - sys: { - id: string - linkType: ContentEntityType - type: string - } - } - environment?: Link - scheduledFor: { - /** ISO 8601 string */ - datetime: string - } - action: ScheduledActionActionType -} - -export interface ContentTypeField extends Items { - id: string - name: string - required: boolean - localized: boolean - disabled?: boolean - omitted?: boolean - deleted?: boolean - items?: Items - apiName?: string -} - -export interface ContentType { - sys: { - type: string - id: string - version: number - createdBy?: Link - createdAt: string - updatedBy?: Link - updatedAt: string - space: Link - environment: Link - firstPublishedAt?: string - publishedCounter?: number - publishedVersion?: number - } - fields: ContentTypeField[] - name: string - displayField: string - description: string -} - -interface EditorWidget { - widgetId: string - widgetNamespace: string - settings?: Object -} - -export interface EditorInterface { - sys: Object - controls?: Array<{ - fieldId: string - widgetId?: string - widgetNamespace?: string - settings?: Object - }> - sidebar?: Array<{ - widgetId: string - widgetNamespace: string - settings?: Object - disabled?: boolean - }> - editor?: EditorWidget - editors?: EditorWidget[] -} - -export interface SpaceMembership { - sys: { - id: string - type: string - } - admin: boolean - roles: { name: string; description: string }[] -} +export type { + TagProps as Tag, + TagVisibility, + UserProps as User, + AssetProps as Asset, + TaskProps as Task, + ScheduledActionProps as ScheduledAction, + ContentTypeProps as ContentType, + EditorInterfaceProps as EditorInterface, + SpaceMembershipProps as SpaceMembership, + ContentFields as ContentTypeField, + EntryProps as Entry, + KeyValueMap, +} from 'contentful-management/types' export interface CanonicalRequest { method: 'GET' | 'PUT' | 'POST' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS' diff --git a/lib/types/entry.types.ts b/lib/types/entry.types.ts index 01e1270266..a773c3c0c7 100644 --- a/lib/types/entry.types.ts +++ b/lib/types/entry.types.ts @@ -36,9 +36,3 @@ export interface EntryAPI extends TaskAPI { */ metadata?: Metadata } - -export type Entry> = { - sys: ContentEntitySys - metadata?: Metadata - fields: Fields -} diff --git a/lib/types/index.ts b/lib/types/index.ts index 0d308cbf62..abf17842de 100644 --- a/lib/types/index.ts +++ b/lib/types/index.ts @@ -42,9 +42,10 @@ export type { Tag, TagVisibility, Task, + Entry, } from './entities' -export type { Entry, EntryAPI, TaskAPI, TaskInputData } from './entry.types' +export type { EntryAPI, TaskAPI, TaskInputData } from './entry.types' export type { FieldInfo, EntryFieldInfo, EntryFieldAPI } from './field.types' diff --git a/lib/types/navigator.types.ts b/lib/types/navigator.types.ts index 2611d624d2..b13148c264 100644 --- a/lib/types/navigator.types.ts +++ b/lib/types/navigator.types.ts @@ -1,3 +1,5 @@ +import { Asset, Entry, KeyValueMap } from './entities' + export interface NavigatorAPIOptions { /** use `waitForClose` if you want promise to be resolved only after slide in editor is closed */ slideIn?: boolean | { waitForClose: boolean } @@ -36,22 +38,22 @@ export interface NavigatorOpenResponse { export interface NavigatorAPI { /** Opens an existing entry in the current Web App session. */ - openEntry: ( + openEntry: ( entryId: string, options?: NavigatorAPIOptions - ) => Promise> + ) => Promise>> /** Opens an existing asset in the current Web App session. */ - openAsset: ( + openAsset: ( assetId: string, options?: NavigatorAPIOptions - ) => Promise> + ) => Promise> /** Opens a new entry in the current Web App session. */ - openNewEntry: ( + openNewEntry: ( contentTypeId: string, options?: NavigatorAPIOptions - ) => Promise> + ) => Promise>> /** Opens a new asset in the current Web App session. */ - openNewAsset: (options: NavigatorAPIOptions) => Promise> + openNewAsset: (options: NavigatorAPIOptions) => Promise> /** Navigates to a page extension in the current Web App session. Calling without `options` will navigate to the home route of your page extension. */ openPageExtension: (options?: PageExtensionOptions) => Promise /** Navigates to the app's page location. */ diff --git a/lib/types/space.types.ts b/lib/types/space.types.ts index 272a1b1f6c..53a896820c 100644 --- a/lib/types/space.types.ts +++ b/lib/types/space.types.ts @@ -1,4 +1,3 @@ -import { Entry } from './entry.types' import { Asset, CanonicalRequest, @@ -8,6 +7,8 @@ import { Tag, User, TagVisibility, + KeyValueMap, + Entry, } from './entities' import { CollectionResponse, @@ -43,8 +44,10 @@ export interface SpaceAPI { updateContentType: (data: ContentType) => Promise deleteContentType: (data: ContentType) => Promise - getEntry: (id: string) => Promise> - getEntrySnapshots: (id: string) => Promise>>> + getEntry: (id: string) => Promise> + getEntrySnapshots: ( + id: string + ) => Promise>>> getEntries: ( query?: Query ) => Promise>> @@ -52,12 +55,22 @@ export interface SpaceAPI { contentTypeId: string, data: WithOptionalId> ) => Promise> - updateEntry: (data: Entry) => Promise> - publishEntry: (data: Entry) => Promise> - unpublishEntry: (data: Entry) => Promise> - archiveEntry: (data: Entry) => Promise> - unarchiveEntry: (data: Entry) => Promise> - deleteEntry: (data: Entry) => Promise + updateEntry: ( + data: Entry + ) => Promise> + publishEntry: ( + data: Entry + ) => Promise> + unpublishEntry: ( + data: Entry + ) => Promise> + archiveEntry: ( + data: Entry + ) => Promise> + unarchiveEntry: ( + data: Entry + ) => Promise> + deleteEntry: (data: Entry) => Promise getPublishedEntries: ( query?: Query ) => Promise>> diff --git a/package-lock.json b/package-lock.json index 4e63f07a3e..239c58bc28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1259,8 +1259,7 @@ "@types/json-patch": { "version": "0.0.30", "resolved": "https://registry.npmjs.org/@types/json-patch/-/json-patch-0.0.30.tgz", - "integrity": "sha512-MhCUjojzDhVLnZnxwPwa+rETFRDQ0ffjxYdrqOP6TBO2O0/Z64PV5tNeYApo4bc4y4frbWOrRwv/eEkXlI13Rw==", - "dev": true + "integrity": "sha512-MhCUjojzDhVLnZnxwPwa+rETFRDQ0ffjxYdrqOP6TBO2O0/Z64PV5tNeYApo4bc4y4frbWOrRwv/eEkXlI13Rw==" }, "@types/json-schema": { "version": "7.0.7", @@ -1372,13 +1371,13 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.23.0.tgz", - "integrity": "sha512-tGK1y3KIvdsQEEgq6xNn1DjiFJtl+wn8JJQiETtCbdQxw1vzjXyAaIkEmO2l6Nq24iy3uZBMFQjZ6ECf1QdgGw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.24.0.tgz", + "integrity": "sha512-qbCgkPM7DWTsYQGjx9RTuQGswi+bEt0isqDBeo+CKV0953zqI0Tp7CZ7Fi9ipgFA6mcQqF4NOVNwS/f2r6xShw==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.23.0", - "@typescript-eslint/scope-manager": "4.23.0", + "@typescript-eslint/experimental-utils": "4.24.0", + "@typescript-eslint/scope-manager": "4.24.0", "debug": "^4.1.1", "functional-red-black-tree": "^1.0.1", "lodash": "^4.17.15", @@ -1399,107 +1398,55 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.23.0.tgz", - "integrity": "sha512-WAFNiTDnQfrF3Z2fQ05nmCgPsO5o790vOhmWKXbbYQTO9erE1/YsFot5/LnOUizLzU2eeuz6+U/81KV5/hFTGA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.24.0.tgz", + "integrity": "sha512-IwTT2VNDKH1h8RZseMH4CcYBz6lTvRoOLDuuqNZZoThvfHEhOiZPQCow+5El3PtyxJ1iDr6UXZwYtE3yZQjhcw==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.23.0", - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/typescript-estree": "4.23.0", + "@typescript-eslint/scope-manager": "4.24.0", + "@typescript-eslint/types": "4.24.0", + "@typescript-eslint/typescript-estree": "4.24.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.23.0.tgz", - "integrity": "sha512-wsvjksHBMOqySy/Pi2Q6UuIuHYbgAMwLczRl4YanEPKW5KVxI9ZzDYh3B5DtcZPQTGRWFJrfcbJ6L01Leybwug==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.24.0.tgz", + "integrity": "sha512-dj1ZIh/4QKeECLb2f/QjRwMmDArcwc2WorWPRlB8UNTZlY1KpTVsbX7e3ZZdphfRw29aTFUSNuGB8w9X5sS97w==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.23.0", - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/typescript-estree": "4.23.0", + "@typescript-eslint/scope-manager": "4.24.0", + "@typescript-eslint/types": "4.24.0", + "@typescript-eslint/typescript-estree": "4.24.0", "debug": "^4.1.1" - }, - "dependencies": { - "@typescript-eslint/scope-manager": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.23.0.tgz", - "integrity": "sha512-ZZ21PCFxPhI3n0wuqEJK9omkw51wi2bmeKJvlRZPH5YFkcawKOuRMQMnI8mH6Vo0/DoHSeZJnHiIx84LmVQY+w==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/visitor-keys": "4.23.0" - } - }, - "@typescript-eslint/types": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.23.0.tgz", - "integrity": "sha512-oqkNWyG2SLS7uTWLZf6Sr7Dm02gA5yxiz1RP87tvsmDsguVATdpVguHr4HoGOcFOpCvx9vtCSCyQUGfzq28YCw==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.23.0.tgz", - "integrity": "sha512-5Sty6zPEVZF5fbvrZczfmLCOcby3sfrSPu30qKoY1U3mca5/jvU5cwsPb/CO6Q3ByRjixTMIVsDkqwIxCf/dMw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/visitor-keys": "4.23.0", - "debug": "^4.1.1", - "globby": "^11.0.1", - "is-glob": "^4.0.1", - "semver": "^7.3.2", - "tsutils": "^3.17.1" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.23.0.tgz", - "integrity": "sha512-5PNe5cmX9pSifit0H+nPoQBXdbNzi5tOEec+3riK+ku4e3er37pKxMKDH5Ct5Y4fhWxcD4spnlYjxi9vXbSpwg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "4.23.0", - "eslint-visitor-keys": "^2.0.0" - } - }, - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "@typescript-eslint/scope-manager": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.23.0.tgz", - "integrity": "sha512-ZZ21PCFxPhI3n0wuqEJK9omkw51wi2bmeKJvlRZPH5YFkcawKOuRMQMnI8mH6Vo0/DoHSeZJnHiIx84LmVQY+w==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.24.0.tgz", + "integrity": "sha512-9+WYJGDnuC9VtYLqBhcSuM7du75fyCS/ypC8c5g7Sdw7pGL4NDTbeH38eJPfzIydCHZDoOgjloxSAA3+4l/zsA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/visitor-keys": "4.23.0" + "@typescript-eslint/types": "4.24.0", + "@typescript-eslint/visitor-keys": "4.24.0" } }, "@typescript-eslint/types": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.23.0.tgz", - "integrity": "sha512-oqkNWyG2SLS7uTWLZf6Sr7Dm02gA5yxiz1RP87tvsmDsguVATdpVguHr4HoGOcFOpCvx9vtCSCyQUGfzq28YCw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.24.0.tgz", + "integrity": "sha512-tkZUBgDQKdvfs8L47LaqxojKDE+mIUmOzdz7r+u+U54l3GDkTpEbQ1Jp3cNqqAU9vMUCBA1fitsIhm7yN0vx9Q==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.23.0.tgz", - "integrity": "sha512-5Sty6zPEVZF5fbvrZczfmLCOcby3sfrSPu30qKoY1U3mca5/jvU5cwsPb/CO6Q3ByRjixTMIVsDkqwIxCf/dMw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.24.0.tgz", + "integrity": "sha512-kBDitL/by/HK7g8CYLT7aKpAwlR8doshfWz8d71j97n5kUa5caHWvY0RvEUEanL/EqBJoANev8Xc/mQ6LLwXGA==", "dev": true, "requires": { - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/visitor-keys": "4.23.0", + "@typescript-eslint/types": "4.24.0", + "@typescript-eslint/visitor-keys": "4.24.0", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -1519,12 +1466,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.23.0.tgz", - "integrity": "sha512-5PNe5cmX9pSifit0H+nPoQBXdbNzi5tOEec+3riK+ku4e3er37pKxMKDH5Ct5Y4fhWxcD4spnlYjxi9vXbSpwg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.24.0.tgz", + "integrity": "sha512-4ox1sjmGHIxjEDBnMCtWFFhErXtKA1Ec0sBpuz0fqf3P+g3JFGyTxxbF06byw0FRsPnnbq44cKivH7Ks1/0s6g==", "dev": true, "requires": { - "@typescript-eslint/types": "4.23.0", + "@typescript-eslint/types": "4.24.0", "eslint-visitor-keys": "^2.0.0" } }, @@ -1997,7 +1944,6 @@ "version": "0.21.1", "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", - "dev": true, "requires": { "follow-redirects": "^1.10.0" } @@ -2122,7 +2068,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", - "dev": true, "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.0" @@ -2521,10 +2466,9 @@ } }, "contentful-management": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/contentful-management/-/contentful-management-7.19.1.tgz", - "integrity": "sha512-sGcp/B5dBKVzPGiuhEBGr1Q4oKE/WR9XV0UNyje6jNGXdeW0SEMbu/VFWBYfvc3zFNeU84dChGyW77igol/vHA==", - "dev": true, + "version": "7.22.0", + "resolved": "https://registry.npmjs.org/contentful-management/-/contentful-management-7.22.0.tgz", + "integrity": "sha512-Vc4EcNTm8B4Q+l5vNge4V2MwGhEceBJWJ09NSgryANEaX3vaUe+XQplYvMTrs9xiVXvozcHDc+03JXPv1JYXmw==", "requires": { "@types/json-patch": "0.0.30", "axios": "^0.21.0", @@ -2537,8 +2481,7 @@ "type-fest": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.0.2.tgz", - "integrity": "sha512-a720oz3Kjbp3ll0zkeN9qjRhO7I34MKMhPGQiQJAmaZQZQ1lo+NWThK322f7sXV+kTg9B1Ybt16KgBXWgteT8w==", - "dev": true + "integrity": "sha512-a720oz3Kjbp3ll0zkeN9qjRhO7I34MKMhPGQiQJAmaZQZQ1lo+NWThK322f7sXV+kTg9B1Ybt16KgBXWgteT8w==" } } }, @@ -2546,7 +2489,6 @@ "version": "6.8.0", "resolved": "https://registry.npmjs.org/contentful-sdk-core/-/contentful-sdk-core-6.8.0.tgz", "integrity": "sha512-X45uNrcbQ2qY2p4G/Wx2EFUdnLnoDXjw29i+d0JVTUXqCG58p3q4GHuAPzTX+uafJL4h0ZY2xPOn4nvJ83eRBQ==", - "dev": true, "requires": { "fast-copy": "^2.1.0", "qs": "^6.9.4" @@ -2556,7 +2498,6 @@ "version": "6.10.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", "integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==", - "dev": true, "requires": { "side-channel": "^1.0.4" } @@ -4177,8 +4118,7 @@ "fast-copy": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-2.1.1.tgz", - "integrity": "sha512-Qod3DdRgFZ8GUIM6ygeoZYpQ0QLW9cf/FS9KhhjlYggcSZXWAemAw8BOCO5LuYCrR3Uj3qXDVTUzOUwG8C7beQ==", - "dev": true + "integrity": "sha512-Qod3DdRgFZ8GUIM6ygeoZYpQ0QLW9cf/FS9KhhjlYggcSZXWAemAw8BOCO5LuYCrR3Uj3qXDVTUzOUwG8C7beQ==" }, "fast-deep-equal": { "version": "2.0.1", @@ -4392,8 +4332,7 @@ "follow-redirects": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", - "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==", - "dev": true + "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==" }, "forever-agent": { "version": "0.6.1", @@ -4473,8 +4412,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "functional-red-black-tree": { "version": "1.0.1", @@ -4498,7 +4436,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.1.tgz", "integrity": "sha512-ZnWP+AmS1VUaLgTRy47+zKtjTxz+0xMpx3I52i+aalBK1QP19ggLF3Db89KJX7kjfOfP2eoa01qc++GwPgufPg==", - "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -4692,7 +4629,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -4729,8 +4665,7 @@ "has-symbols": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", - "dev": true + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" }, "he": { "version": "1.2.0", @@ -6395,8 +6330,7 @@ "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" }, "lodash.isstring": { "version": "4.0.1", @@ -12370,9 +12304,9 @@ } }, "rollup": { - "version": "2.47.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.47.0.tgz", - "integrity": "sha512-rqBjgq9hQfW0vRmz+0S062ORRNJXvwRpzxhFXORvar/maZqY6za3rgQ/p1Glg+j1hnc1GtYyQCPiAei95uTElg==", + "version": "2.48.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.48.0.tgz", + "integrity": "sha512-wl9ZSSSsi5579oscSDYSzGn092tCS076YB+TQrzsGuSfYyJeep8eEWj0eaRjuC5McuMNmcnR8icBqiE/FWNB1A==", "dev": true, "requires": { "fsevents": "~2.3.1" @@ -12898,7 +12832,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, "requires": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -12909,7 +12842,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -12919,8 +12851,7 @@ "object-inspect": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", - "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==", - "dev": true + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==" } } }, diff --git a/package.json b/package.json index 9828905758..e60e4c448d 100644 --- a/package.json +++ b/package.json @@ -50,13 +50,12 @@ "@types/nanoid": "2.1.0", "@types/sinon": "^10.0.0", "@types/sinon-chai": "^3.2.5", - "@typescript-eslint/eslint-plugin": "4.23.0", - "@typescript-eslint/parser": "4.23.0", + "@typescript-eslint/eslint-plugin": "4.24.0", + "@typescript-eslint/parser": "4.24.0", "async-retry": "1.3.1", "babel-eslint": "10.1.0", "chai": "4.3.4", "chai-as-promised": "7.1.1", - "contentful-management": "7.19.1", "cross-spawn": "7.0.3", "cypress": "7.3.0", "cypress-multi-reporters": "1.5.0", @@ -83,7 +82,7 @@ "mochawesome-report-generator": "5.2.0", "nanoid": "3.1.23", "prettier": "2.2.1", - "rollup": "2.47.0", + "rollup": "2.48.0", "rollup-plugin-terser": "7.0.2", "rollup-plugin-typescript2": "0.30.0", "semantic-release": "17.4.2", @@ -149,5 +148,7 @@ "@semantic-release/github" ] }, - "dependencies": {} + "dependencies": { + "contentful-management": "^7.22.0" + } } diff --git a/test/integration/tasks/delete-stale-environments.ts b/test/integration/tasks/delete-stale-environments.ts index 311ef8b1fb..6c8a2cb01c 100644 --- a/test/integration/tasks/delete-stale-environments.ts +++ b/test/integration/tasks/delete-stale-environments.ts @@ -1,7 +1,7 @@ import { getCurrentSpace } from '../contentful-client' import { printStepTitle, sleep } from '../utils' -const ONE_DAY_IN_MS = 60 * 60 * 24 * 1000 +const TWO_HOURS_IN_MS = 60 * 60 * 2 * 1000 export default async (currentSpace = getCurrentSpace) => { printStepTitle('Removing stale environments') @@ -16,7 +16,7 @@ export default async (currentSpace = getCurrentSpace) => { const isStaleEnvironment = (timeStamp: string) => { const environmentDate = new Date(timeStamp).getTime() const difference = Date.now() - environmentDate - return difference >= ONE_DAY_IN_MS + return difference >= TWO_HOURS_IN_MS } const deletedEnvironmentIds: string[] = [] items.forEach(async (environment: any) => {