internal: incomplete vault systems behind feature flag (#2340)
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/** Valid only when running a mock event publisher on port 3124 */
|
||||
export async function purchaseMockSubscription(email: string, subscriptionId: number) {
|
||||
const response = await fetch('http://localhost:3124/events', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
eventType: 'SUBSCRIPTION_PURCHASED',
|
||||
eventPayload: {
|
||||
userEmail: email,
|
||||
subscriptionId: subscriptionId,
|
||||
subscriptionName: 'PRO_PLAN',
|
||||
subscriptionExpiresAt: (new Date().getTime() + 3_600_000) * 1_000,
|
||||
timestamp: Date.now(),
|
||||
offline: false,
|
||||
discountCode: null,
|
||||
limitedDiscountPurchased: false,
|
||||
newSubscriber: true,
|
||||
totalActiveSubscriptionsCount: 1,
|
||||
userRegisteredAt: 1,
|
||||
billingFrequency: 12,
|
||||
payAmount: 59.0,
|
||||
},
|
||||
}),
|
||||
})
|
||||
|
||||
if (!response.ok) {
|
||||
console.error(`Failed to publish mocked event: ${response.status} ${response.statusText}`)
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { DecryptedItem, SNTag, WebApplicationInterface } from '@standardnotes/snjs'
|
||||
import { DecryptedItem, SNTag } from '@standardnotes/snjs'
|
||||
import { WebApplicationInterface } from '@standardnotes/ui-services'
|
||||
|
||||
type ReturnType =
|
||||
| {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { IconType, FileItem, SNNote, DecryptedItem, SNTag, WebApplicationInterface } from '@standardnotes/snjs'
|
||||
import { IconType, FileItem, SNNote, DecryptedItem, SNTag } from '@standardnotes/snjs'
|
||||
import { getIconAndTintForNoteType } from './getIconAndTintForNoteType'
|
||||
import { getIconForFileType } from './getIconForFileType'
|
||||
import { WebApplicationInterface } from '@standardnotes/ui-services'
|
||||
|
||||
export function getIconForItem(item: DecryptedItem, application: WebApplicationInterface): [IconType, string] {
|
||||
if (item instanceof SNNote) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { WebApplicationInterface, DecryptedItemInterface, ItemContent, isNote, isTag } from '@standardnotes/snjs'
|
||||
import { DecryptedItemInterface, ItemContent, isNote, isTag } from '@standardnotes/snjs'
|
||||
import { WebApplicationInterface } from '@standardnotes/ui-services'
|
||||
|
||||
export function getItemTitleInContextOfLinkBubble(item: DecryptedItemInterface<ItemContent>) {
|
||||
return item.title && item.title.length > 0 ? item.title : isNote(item) ? item.preview_plain : ''
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { WebApplicationInterface, naturalSort, ContentType } from '@standardnotes/snjs'
|
||||
import { naturalSort, ContentType } from '@standardnotes/snjs'
|
||||
import { createLinkFromItem } from './createLinkFromItem'
|
||||
import { doesItemMatchSearchQuery } from './doesItemMatchSearchQuery'
|
||||
import { isSearchResultAlreadyLinkedToItem } from './isSearchResultAlreadyLinkedToItem'
|
||||
import { isSearchResultExistingTag } from './isSearchResultExistingTag'
|
||||
import { ItemLink } from './ItemLink'
|
||||
import { LinkableItem } from './LinkableItem'
|
||||
import { WebApplicationInterface } from '@standardnotes/ui-services'
|
||||
|
||||
const MaxLinkedResults = 50
|
||||
|
||||
|
||||
Reference in New Issue
Block a user