diff --git a/.githooks/commit-msg b/.githooks/commit-msg index 3f62723c25..115005abe0 100755 --- a/.githooks/commit-msg +++ b/.githooks/commit-msg @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # The script below adds the branch name automatically to # every one of your commit messages. The regular expression # below searches for linear issue key's. The issue key will @@ -24,4 +24,4 @@ fi if [[ "$COMMIT_TEXT" != "GO-"* ]]; then echo "$ISSUE_ID" "$COMMIT_TEXT" > "$COMMIT_MSG_FILE" -fi \ No newline at end of file +fi diff --git a/Makefile b/Makefile index 6663d3efb5..cf84d0f5b5 100644 --- a/Makefile +++ b/Makefile @@ -260,7 +260,7 @@ protos-swift: @echo 'Generating swift protobuf files' @protoc -I ./ --swift_opt=FileNaming=DropPath --swift_opt=Visibility=Public --swift_out=./dist/ios/protobuf pb/protos/*.proto pkg/lib/pb/model/protos/*.proto @echo 'Generated swift protobuf files at ./dist/ios/pb' - + protos-swift-local: protos-swift @echo 'Clear proto files' @rm -rf ./dist/ios/protobuf/protos @@ -325,14 +325,14 @@ install-linter: run-linter: ifdef GOLANGCI_LINT_BRANCH @golangci-lint run -v ./... --new-from-rev=$(GOLANGCI_LINT_BRANCH) --timeout 15m --verbose -else +else @golangci-lint run -v ./... --new-from-rev=origin/main --timeout 15m --verbose endif run-linter-fix: ifdef GOLANGCI_LINT_BRANCH @golangci-lint run -v ./... --new-from-rev=$(GOLANGCI_LINT_BRANCH) --timeout 15m --fix -else +else @golangci-lint run -v ./... --new-from-rev=origin/main --timeout 15m --fix endif @@ -390,4 +390,4 @@ download-tantivy-all: download-tantivy download-tantivy-local: remove-libs @mkdir -p $(OUTPUT_DIR) - @cp -r $(TANTIVY_GO_PATH)/libs/ $(OUTPUT_DIR) \ No newline at end of file + @cp -r $(TANTIVY_GO_PATH)/libs/* $(OUTPUT_DIR) diff --git a/README.md b/README.md index f2ec9c3ec3..77365e69d5 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Middleware library for Anytype, distributed as part of the Anytype clients. - [Project workflows](docs/Flow.md) ### CLI tools -- [Usecase generator](docs/UsecaseGenerator.md) +- [Usecase validator](docs/UsecaseValidator.md) - [Export Archive unpacker](docs/ExportArchiveUnpacker.md) ## Contribution diff --git a/core/block/editor/chatobject/chatobject_test.go b/core/block/editor/chatobject/chatobject_test.go index ef99754b44..1c5a5ea68f 100644 --- a/core/block/editor/chatobject/chatobject_test.go +++ b/core/block/editor/chatobject/chatobject_test.go @@ -2,11 +2,13 @@ package chatobject import ( "context" + "errors" "fmt" "path/filepath" "testing" anystore "github.com/anyproto/any-store" + "github.com/globalsign/mgo/bson" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -38,7 +40,9 @@ func (a *accountServiceStub) AccountID() string { type fixture struct { *storeObject - source *mock_source.MockStore + source *mock_source.MockStore + accountServiceStub *accountServiceStub + sourceCreator string } const testCreator = "accountId1" @@ -58,8 +62,15 @@ func newFixture(t *testing.T) *fixture { object := New(sb, accountService, dbProvider, eventSender) + fx := &fixture{ + storeObject: object.(*storeObject), + accountServiceStub: accountService, + sourceCreator: testCreator, + } source := mock_source.NewMockStore(t) source.EXPECT().ReadStoreDoc(ctx, mock.Anything, mock.Anything).Return(nil) + source.EXPECT().PushStoreChange(mock.Anything, mock.Anything).RunAndReturn(fx.applyToStore).Maybe() + fx.source = source err = object.Init(&smartblock.InitContext{ Ctx: ctx, @@ -67,10 +78,7 @@ func newFixture(t *testing.T) *fixture { }) require.NoError(t, err) - return &fixture{ - storeObject: object.(*storeObject), - source: source, - } + return fx } // TODO Test ChatHandler: validate in BeforeCreate that creator from change equals to creator from message @@ -78,13 +86,11 @@ func newFixture(t *testing.T) *fixture { func TestAddMessage(t *testing.T) { ctx := context.Background() fx := newFixture(t) - changeId := "messageId1" - fx.source.EXPECT().PushStoreChange(mock.Anything, mock.Anything).RunAndReturn(applyToStore(changeId)) inputMessage := givenMessage() messageId, err := fx.AddMessage(ctx, inputMessage) require.NoError(t, err) - assert.Equal(t, changeId, messageId) + assert.NotEmpty(t, messageId) messages, err := fx.GetMessages(ctx, "", 0) require.NoError(t, err) @@ -96,6 +102,10 @@ func TestAddMessage(t *testing.T) { want.Creator = testCreator got := messages[0] + assertMessagesEqual(t, want, got) +} + +func assertMessagesEqual(t *testing.T, want, got *model.ChatMessage) { // Cleanup order id assert.NotEmpty(t, got.OrderId) got.OrderId = "" @@ -106,69 +116,150 @@ func TestAddMessage(t *testing.T) { } func TestEditMessage(t *testing.T) { - // TODO Test attempt to edit other's message + t.Run("edit own message", func(t *testing.T) { + ctx := context.Background() + fx := newFixture(t) + + // Add + inputMessage := givenMessage() + + messageId, err := fx.AddMessage(ctx, inputMessage) + require.NoError(t, err) + assert.NotEmpty(t, messageId) + + // Edit + editedMessage := givenMessage() + editedMessage.Message.Text = "edited text!" + + err = fx.EditMessage(ctx, messageId, editedMessage) + require.NoError(t, err) + + messages, err := fx.GetMessages(ctx, "", 0) + require.NoError(t, err) + require.Len(t, messages, 1) + + want := editedMessage + want.Id = messageId + want.Creator = testCreator + + got := messages[0] + assertMessagesEqual(t, want, got) + }) + + t.Run("edit other's message", func(t *testing.T) { + ctx := context.Background() + fx := newFixture(t) + // Add + inputMessage := givenMessage() + + messageId, err := fx.AddMessage(ctx, inputMessage) + require.NoError(t, err) + assert.NotEmpty(t, messageId) + + // Edit + editedMessage := givenMessage() + editedMessage.Message.Text = "edited text!" + + fx.sourceCreator = "maliciousPerson" + + err = fx.EditMessage(ctx, messageId, editedMessage) + require.Error(t, err) + + // Check that nothing is changed + messages, err := fx.GetMessages(ctx, "", 0) + require.NoError(t, err) + require.Len(t, messages, 1) + + want := inputMessage + want.Id = messageId + want.Creator = testCreator + + got := messages[0] + assertMessagesEqual(t, want, got) + }) + +} + +func TestToggleReaction(t *testing.T) { ctx := context.Background() fx := newFixture(t) // Add inputMessage := givenMessage() - changeId := "messageId1" - fx.source.EXPECT().PushStoreChange(mock.Anything, mock.Anything).RunAndReturn(applyToStore(changeId)) + inputMessage.Reactions = nil + messageId, err := fx.AddMessage(ctx, inputMessage) require.NoError(t, err) + assert.NotEmpty(t, messageId) // Edit editedMessage := givenMessage() editedMessage.Message.Text = "edited text!" - changeId = "messageId2" - fx.source.EXPECT().PushStoreChange(mock.Anything, mock.Anything).RunAndReturn(applyToStore(changeId)) - err = fx.EditMessage(ctx, messageId, editedMessage) - require.NoError(t, err) + t.Run("can toggle own reactions", func(t *testing.T) { + err = fx.ToggleMessageReaction(ctx, messageId, "👻") + require.NoError(t, err) + err = fx.ToggleMessageReaction(ctx, messageId, "🐻") + require.NoError(t, err) + err = fx.ToggleMessageReaction(ctx, messageId, "👺") + require.NoError(t, err) + err = fx.ToggleMessageReaction(ctx, messageId, "👺") + require.NoError(t, err) + }) + + anotherPerson := "anotherPerson" + + t.Run("can't toggle someone else's reactions", func(t *testing.T) { + fx.sourceCreator = testCreator + fx.accountServiceStub.accountId = anotherPerson + err = fx.ToggleMessageReaction(ctx, messageId, "🐻") + require.Error(t, err) + }) + t.Run("can toggle reactions on someone else's messages", func(t *testing.T) { + fx.sourceCreator = anotherPerson + fx.accountServiceStub.accountId = anotherPerson + err = fx.ToggleMessageReaction(ctx, messageId, "🐻") + require.NoError(t, err) + }) messages, err := fx.GetMessages(ctx, "", 0) require.NoError(t, err) - require.Len(t, messages, 1) - want := editedMessage - want.Id = messageId - want.Creator = testCreator + got := messages[0].Reactions - got := messages[0] - // Cleanup order id - assert.NotEmpty(t, got.OrderId) - got.OrderId = "" - // Cleanup timestamp - assert.NotZero(t, got.CreatedAt) - got.CreatedAt = 0 + want := &model.ChatMessageReactions{ + Reactions: map[string]*model.ChatMessageReactionsIdentityList{ + "👻": { + Ids: []string{testCreator}, + }, + "🐻": { + Ids: []string{testCreator, anotherPerson}, + }, + }, + } assert.Equal(t, want, got) } -func TestToggleReaction(t *testing.T) { - // TODO Implement -} - -func applyToStore(changeId string) func(ctx context.Context, params source.PushStoreChangeParams) (string, error) { - return func(ctx context.Context, params source.PushStoreChangeParams) (string, error) { - tx, err := params.State.NewTx(ctx) - if err != nil { - return "", fmt.Errorf("new tx: %w", err) - } - order := tx.NextOrder(tx.GetMaxOrder()) - err = tx.ApplyChangeSet(storestate.ChangeSet{ - Id: changeId, - Order: order, - Changes: params.Changes, - Creator: testCreator, - Timestamp: params.Time.Unix(), - }) - if err != nil { - return "", fmt.Errorf("apply change set: %w", err) - } - return changeId, tx.Commit() +func (fx *fixture) applyToStore(ctx context.Context, params source.PushStoreChangeParams) (string, error) { + changeId := bson.NewObjectId().Hex() + tx, err := params.State.NewTx(ctx) + if err != nil { + return "", fmt.Errorf("new tx: %w", err) + } + order := tx.NextOrder(tx.GetMaxOrder()) + err = tx.ApplyChangeSet(storestate.ChangeSet{ + Id: changeId, + Order: order, + Changes: params.Changes, + Creator: fx.sourceCreator, + Timestamp: params.Time.Unix(), + }) + if err != nil { + return "", errors.Join(tx.Rollback(), fmt.Errorf("apply change set: %w", err)) } + return changeId, tx.Commit() } func givenMessage() *model.ChatMessage { diff --git a/core/block/editor/converter/layout.go b/core/block/editor/converter/layout.go index ad10315faf..64f7eda827 100644 --- a/core/block/editor/converter/layout.go +++ b/core/block/editor/converter/layout.go @@ -54,6 +54,13 @@ func (c *layoutConverter) Convert(space smartblock.Space, st *state.State, fromL return nil } + if fromLayout == model.ObjectType_chat || fromLayout == model.ObjectType_chatDerived { + return fmt.Errorf("can't convert from chat") + } + if toLayout == model.ObjectType_chat || toLayout == model.ObjectType_chatDerived { + return fmt.Errorf("can't convert to chat") + } + if fromLayout == model.ObjectType_note && toLayout == model.ObjectType_collection { return c.fromNoteToCollection(st) } diff --git a/core/block/editor/objecttype/lastused_test.go b/core/block/editor/objecttype/lastused_test.go index 5c2cf0090d..91d1bd5ed0 100644 --- a/core/block/editor/objecttype/lastused_test.go +++ b/core/block/editor/objecttype/lastused_test.go @@ -24,7 +24,7 @@ func TestSetLastUsedDateForInitialType(t *testing.T) { bundle.TypeKeyCollection.BundledURL(), bundle.TypeKeyTask.BundledURL(), bundle.TypeKeyPage.BundledURL(), - bundle.TypeKeyClassNote.BundledURL(), + bundle.TypeKeyGoal.BundledURL(), bundle.TypeKeyAudio.BundledURL(), } rand.Shuffle(len(ots), func(i, j int) { @@ -45,6 +45,6 @@ func TestSetLastUsedDateForInitialType(t *testing.T) { assert.True(t, isLastUsedDateGreater(detailMap[bundle.TypeKeyTask.BundledURL()], detailMap[bundle.TypeKeySet.BundledURL()])) assert.True(t, isLastUsedDateGreater(detailMap[bundle.TypeKeySet.BundledURL()], detailMap[bundle.TypeKeyCollection.BundledURL()])) assert.True(t, isLastUsedDateGreater(detailMap[bundle.TypeKeyCollection.BundledURL()], detailMap[bundle.TypeKeyAudio.BundledURL()])) - assert.True(t, isLastUsedDateGreater(detailMap[bundle.TypeKeyCollection.BundledURL()], detailMap[bundle.TypeKeyClassNote.BundledURL()])) + assert.True(t, isLastUsedDateGreater(detailMap[bundle.TypeKeyCollection.BundledURL()], detailMap[bundle.TypeKeyGoal.BundledURL()])) }) } diff --git a/core/block/editor/smartblock/links.go b/core/block/editor/smartblock/links.go index 310d4123da..e615ad199c 100644 --- a/core/block/editor/smartblock/links.go +++ b/core/block/editor/smartblock/links.go @@ -37,6 +37,22 @@ func (sb *smartBlock) injectLinksDetails(s *state.State) { s.SetLocalDetail(bundle.RelationKeyLinks.String(), pbtypes.StringList(links)) } +func (sb *smartBlock) injectMentions(s *state.State) { + mentions := objectlink.DependentObjectIDs(s, sb.Space(), objectlink.Flags{ + Blocks: true, + Details: false, + Relations: false, + Types: false, + Collection: false, + DataviewBlockOnlyTarget: true, + NoSystemRelations: true, + NoHiddenBundledRelations: true, + NoImages: true, + }) + mentions = slice.RemoveMut(mentions, sb.Id()) + s.SetLocalDetail(bundle.RelationKeyMentions.String(), pbtypes.StringList(mentions)) +} + func isBacklinksChanged(msgs []simple.EventMessage) bool { for _, msg := range msgs { if amend, ok := msg.Msg.Value.(*pb.EventMessageValueOfObjectDetailsAmend); ok { diff --git a/core/block/editor/smartblock/smartblock.go b/core/block/editor/smartblock/smartblock.go index 16aed8fdd0..9b5aeacce8 100644 --- a/core/block/editor/smartblock/smartblock.go +++ b/core/block/editor/smartblock/smartblock.go @@ -1463,6 +1463,7 @@ func (sb *smartBlock) injectDerivedDetails(s *state.State, spaceID string, sbt s } sb.injectLinksDetails(s) + sb.injectMentions(s) sb.updateBackLinks(s) } diff --git a/core/block/object/objectcreator/chat.go b/core/block/object/objectcreator/chat.go index 6e0d29791f..bdf53f487d 100644 --- a/core/block/object/objectcreator/chat.go +++ b/core/block/object/objectcreator/chat.go @@ -3,23 +3,38 @@ package objectcreator import ( "context" "fmt" + "time" "github.com/gogo/protobuf/types" "github.com/anyproto/anytype-heart/core/block/editor/state" + "github.com/anyproto/anytype-heart/core/block/object/payloadcreator" "github.com/anyproto/anytype-heart/core/domain" "github.com/anyproto/anytype-heart/pkg/lib/bundle" + "github.com/anyproto/anytype-heart/pkg/lib/core/smartblock" "github.com/anyproto/anytype-heart/pkg/lib/pb/model" "github.com/anyproto/anytype-heart/space/clientspace" "github.com/anyproto/anytype-heart/util/pbtypes" ) func (s *service) createChat(ctx context.Context, space clientspace.Space, details *types.Struct) (string, *types.Struct, error) { - createState := state.NewDoc("", nil).(*state.State) + payload, err := space.CreateTreePayload(ctx, payloadcreator.PayloadCreationParams{ + Time: time.Now(), + SmartblockType: smartblock.SmartBlockTypeChatObject, + }) + if err != nil { + return "", nil, fmt.Errorf("create tree payload: %w", err) + } + + createState := state.NewDoc(payload.RootRawChange.Id, nil).(*state.State) details.Fields[bundle.RelationKeyLayout.String()] = pbtypes.Int64(int64(model.ObjectType_chat)) createState.SetDetails(details) + err = s.addChatDerivedObject(ctx, space, createState, payload.RootRawChange.Id) + if err != nil { + return "", nil, fmt.Errorf("add chat derived object: %w", err) + } - id, newDetails, err := s.CreateSmartBlockFromStateInSpace(ctx, space, []domain.TypeKey{bundle.TypeKeyChat}, createState) + id, newDetails, err := s.CreateSmartBlockFromStateInSpaceWithOptions(ctx, space, []domain.TypeKey{bundle.TypeKeyChat}, createState, WithPayload(&payload)) if err != nil { return "", nil, fmt.Errorf("create smartblock from state: %w", err) } @@ -27,6 +42,29 @@ func (s *service) createChat(ctx context.Context, space clientspace.Space, detai return id, newDetails, nil } +func (s *service) addChatDerivedObject(ctx context.Context, space clientspace.Space, st *state.State, chatObjectId string) error { + chatDetails := &types.Struct{Fields: map[string]*types.Value{}} + chatUniqueKey, err := domain.NewUniqueKey(smartblock.SmartBlockTypeChatDerivedObject, chatObjectId) + if err != nil { + return fmt.Errorf("create payload: %w", err) + } + chatDetails.Fields[bundle.RelationKeyUniqueKey.String()] = pbtypes.String(chatUniqueKey.Marshal()) + + chatReq := CreateObjectRequest{ + ObjectTypeKey: bundle.TypeKeyChatDerived, + Details: chatDetails, + } + + chatId, _, err := s.createObjectInSpace(ctx, space, chatReq) + if err != nil { + return fmt.Errorf("create object: %w", err) + } + + st.SetDetailAndBundledRelation(bundle.RelationKeyChatId, pbtypes.String(chatId)) + st.SetDetailAndBundledRelation(bundle.RelationKeyHasChat, pbtypes.Bool(true)) + return nil +} + func (s *service) createChatDerived(ctx context.Context, space clientspace.Space, details *types.Struct) (string, *types.Struct, error) { uniqueKey := pbtypes.GetString(details, bundle.RelationKeyUniqueKey.String()) key, err := domain.UnmarshalUniqueKey(uniqueKey) diff --git a/core/block/object/objectcreator/installer_test.go b/core/block/object/objectcreator/installer_test.go index 6adc80478c..df100fd4a0 100644 --- a/core/block/object/objectcreator/installer_test.go +++ b/core/block/object/objectcreator/installer_test.go @@ -33,14 +33,14 @@ func TestInstaller_queryDeletedObjects(t *testing.T) { }{ {false, false, spaceId, bundle.TypeKeyGoal}, {false, false, spaceId, bundle.RelationKeyGenre}, - {true, false, spaceId, bundle.TypeKeyDailyPlan}, + {true, false, spaceId, bundle.TypeKeyTask}, {true, false, spaceId, bundle.RelationKeyLinkedProjects}, {false, true, spaceId, bundle.TypeKeyBook}, {false, true, spaceId, bundle.RelationKeyStarred}, {true, true, spaceId, bundle.TypeKeyProject}, // not valid, but we should handle this {true, true, spaceId, bundle.RelationKeyArtist}, // not valid, but we should handle this {false, true, "otherSpaceId", bundle.TypeKeyDiaryEntry}, - {true, false, "otherSpaceId", bundle.RelationKeyComposer}, + {true, false, "otherSpaceId", bundle.RelationKeyAudioAlbum}, } { store.AddObjects(t, []objectstore.TestObject{{ bundle.RelationKeyId: pbtypes.String(obj.key.URL()), diff --git a/core/block/object/objectgraph/graph_test.go b/core/block/object/objectgraph/graph_test.go index 2c0c8eaabf..2dd282f921 100644 --- a/core/block/object/objectgraph/graph_test.go +++ b/core/block/object/objectgraph/graph_test.go @@ -50,7 +50,7 @@ func Test(t *testing.T) { {Relation: bundle.MustGetRelation(bundle.RelationKeyId)}, {Relation: bundle.MustGetRelation(bundle.RelationKeyName)}, {Relation: bundle.MustGetRelation(bundle.RelationKeyAuthor)}, - {Relation: bundle.MustGetRelation(bundle.RelationKeyAttachments)}, + {Relation: bundle.MustGetRelation(bundle.RelationKeyLinkedProjects)}, }, nil) fixture.subscriptionServiceMock.EXPECT().Search(mock.Anything).Return(&subscription.SubscribeResponse{ Records: []*types.Struct{}, @@ -72,7 +72,7 @@ func Test(t *testing.T) { {Relation: bundle.MustGetRelation(bundle.RelationKeyId)}, {Relation: bundle.MustGetRelation(bundle.RelationKeyName)}, {Relation: bundle.MustGetRelation(bundle.RelationKeyAssignee)}, - {Relation: bundle.MustGetRelation(bundle.RelationKeyAttachments)}, + {Relation: bundle.MustGetRelation(bundle.RelationKeyLinkedProjects)}, }, nil) fixture.subscriptionServiceMock.EXPECT().Search(mock.Anything).Return(&subscription.SubscribeResponse{ Records: []*types.Struct{ @@ -125,7 +125,7 @@ func Test_isRelationShouldBeIncludedAsEdge(t *testing.T) { false, }, {"file relation", - &relationutils.Relation{Relation: bundle.MustGetRelation(bundle.RelationKeyTrailer)}, + &relationutils.Relation{Relation: bundle.MustGetRelation(bundle.RelationKeyPicture)}, true, }, {"custom relation", diff --git a/core/block/restriction/object.go b/core/block/restriction/object.go index e29ea7f88c..56c65d93c8 100644 --- a/core/block/restriction/object.go +++ b/core/block/restriction/object.go @@ -85,6 +85,8 @@ var ( model.Restrictions_Template, }, model.ObjectType_participant: objRestrictAll, + model.ObjectType_chat: objRestrictEdit, + model.ObjectType_chatDerived: objRestrictEdit, } objectRestrictionsBySBType = map[smartblock.SmartBlockType]ObjectRestrictions{ diff --git a/core/block/restriction/object_test.go b/core/block/restriction/object_test.go index a8d29965ae..4a213be13b 100644 --- a/core/block/restriction/object_test.go +++ b/core/block/restriction/object_test.go @@ -47,7 +47,7 @@ func TestService_ObjectRestrictionsById(t *testing.T) { }) t.Run("ordinary type", func(t *testing.T) { - assert.NoError(t, rs.GetRestrictions(givenObjectType(bundle.TypeKeyDailyPlan)).Object.Check( + assert.NoError(t, rs.GetRestrictions(givenObjectType(bundle.TypeKeyDiaryEntry)).Object.Check( model.Restrictions_Details, model.Restrictions_Delete, model.Restrictions_CreateObjectOfThisType, @@ -55,14 +55,14 @@ func TestService_ObjectRestrictionsById(t *testing.T) { }) t.Run("ordinary type has basic restrictions", func(t *testing.T) { - assert.ErrorIs(t, rs.GetRestrictions(givenObjectType(bundle.TypeKeyDailyPlan)).Object.Check( + assert.ErrorIs(t, rs.GetRestrictions(givenObjectType(bundle.TypeKeyDiaryEntry)).Object.Check( model.Restrictions_Blocks, model.Restrictions_LayoutChange, ), ErrRestricted) }) t.Run("ordinary relation has basic restrictions", func(t *testing.T) { - assert.ErrorIs(t, rs.GetRestrictions(givenObjectType(bundle.TypeKeyDailyPlan)).Object.Check( + assert.ErrorIs(t, rs.GetRestrictions(givenObjectType(bundle.TypeKeyDiaryEntry)).Object.Check( model.Restrictions_TypeChange, ), ErrRestricted) }) @@ -73,7 +73,7 @@ func TestService_ObjectRestrictionsById(t *testing.T) { }) t.Run("ordinary relation", func(t *testing.T) { - assert.NoError(t, rs.GetRestrictions(givenRelation(bundle.RelationKeyImdbRating)).Object.Check( + assert.NoError(t, rs.GetRestrictions(givenRelation(bundle.RelationKeyAudioLyrics)).Object.Check( model.Restrictions_Delete, model.Restrictions_Relations, model.Restrictions_Details, diff --git a/core/block/template/service_test.go b/core/block/template/service_test.go index 4fde5406d7..71d75857b9 100644 --- a/core/block/template/service_test.go +++ b/core/block/template/service_test.go @@ -188,7 +188,7 @@ func TestService_CreateTemplateStateWithDetails(t *testing.T) { t.Run("template typeKey is removed", func(t *testing.T) { // given - tmpl := NewTemplateTest(templateName, bundle.TypeKeyWeeklyPlan.String()) + tmpl := NewTemplateTest(templateName, bundle.TypeKeyGoal.String()) s := service{picker: &testPicker{sb: tmpl}} // when @@ -196,7 +196,7 @@ func TestService_CreateTemplateStateWithDetails(t *testing.T) { // then assert.NoError(t, err) - assert.Equal(t, bundle.TypeKeyWeeklyPlan, st.ObjectTypeKey()) + assert.Equal(t, bundle.TypeKeyGoal, st.ObjectTypeKey()) }) for _, layout := range []model.ObjectTypeLayout{ diff --git a/core/create.go b/core/create.go index 1e25536f4d..a6546700be 100644 --- a/core/create.go +++ b/core/create.go @@ -3,16 +3,14 @@ package core import ( "context" "errors" + "fmt" "github.com/gogo/protobuf/types" "github.com/anyproto/anytype-heart/core/block" "github.com/anyproto/anytype-heart/core/block/object/objectcreator" - "github.com/anyproto/anytype-heart/core/domain" "github.com/anyproto/anytype-heart/pb" "github.com/anyproto/anytype-heart/pkg/lib/bundle" - "github.com/anyproto/anytype-heart/pkg/lib/core/smartblock" - "github.com/anyproto/anytype-heart/pkg/lib/pb/model" "github.com/anyproto/anytype-heart/util/pbtypes" ) @@ -39,73 +37,18 @@ func (mw *Middleware) ObjectCreate(cctx context.Context, req *pb.RpcObjectCreate if err != nil { return response(pb.RpcObjectCreateResponseError_UNKNOWN_ERROR, "", nil, err) } - if req.WithChat || model.ObjectTypeLayout(pbtypes.GetInt64(newDetails, bundle.RelationKeyLayout.String())) == model.ObjectType_chat { - _, err = mw.addChat(cctx, id) - if err != nil { - return response(pb.RpcObjectCreateResponseError_UNKNOWN_ERROR, "", nil, err) - } + if req.WithChat { + return response(pb.RpcObjectCreateResponseError_UNKNOWN_ERROR, "", nil, fmt.Errorf("WithChat is not implemented")) } return response(pb.RpcObjectCreateResponseError_NULL, id, newDetails, nil) } -// TODO Should be in object creator service -func (mw *Middleware) addChat(cctx context.Context, objectId string) (string, error) { - var spaceId string - err := mw.doBlockService(func(bs *block.Service) error { - sb, err := bs.GetObject(cctx, objectId) - if err != nil { - return err - } - spaceId = sb.SpaceID() - return nil - }) - if err != nil { - return "", err - } - - chatDetails := &types.Struct{Fields: map[string]*types.Value{}} - chatUniqueKey, err := domain.NewUniqueKey(smartblock.SmartBlockTypeChatDerivedObject, objectId) - if err != nil { - return "", err - } - chatDetails.Fields[bundle.RelationKeyUniqueKey.String()] = pbtypes.String(chatUniqueKey.Marshal()) - - chatReq := objectcreator.CreateObjectRequest{ - ObjectTypeKey: bundle.TypeKeyChatDerived, - Details: chatDetails, - } - - chatId, _, err := getService[objectcreator.Service](mw).CreateObject(cctx, spaceId, chatReq) - if err != nil { - return "", err - } - - err = mw.doBlockService(func(bs *block.Service) (err error) { - return bs.ModifyDetails(objectId, func(current *types.Struct) (*types.Struct, error) { - if current == nil { - return nil, errors.New("object not found") - } - current.Fields[bundle.RelationKeyChatId.String()] = pbtypes.String(chatId) - current.Fields[bundle.RelationKeyHasChat.String()] = pbtypes.Bool(true) - return current, nil - }) - }) - return chatId, err -} - func (mw *Middleware) ObjectChatAdd(cctx context.Context, req *pb.RpcObjectChatAddRequest) *pb.RpcObjectChatAddResponse { - chatId, err := mw.addChat(cctx, req.ObjectId) - - code := mapErrorCode(err, - errToCode(err, pb.RpcObjectChatAddResponseError_UNKNOWN_ERROR), - ) - return &pb.RpcObjectChatAddResponse{ Error: &pb.RpcObjectChatAddResponseError{ - Code: code, - Description: getErrorDescription(err), + Code: pb.RpcObjectChatAddResponseError_UNKNOWN_ERROR, + Description: "not implemented", }, - ChatId: chatId, } } @@ -144,10 +87,7 @@ func (mw *Middleware) ObjectCreateSet(cctx context.Context, req *pb.RpcObjectCre return response(pb.RpcObjectCreateSetResponseError_UNKNOWN_ERROR, "", nil, err) } if req.WithChat { - _, err = mw.addChat(cctx, id) - if err != nil { - return response(pb.RpcObjectCreateSetResponseError_UNKNOWN_ERROR, "", nil, err) - } + return response(pb.RpcObjectCreateSetResponseError_UNKNOWN_ERROR, "", nil, fmt.Errorf("WithChat is not implemented")) } return response(pb.RpcObjectCreateSetResponseError_NULL, id, newDetails, nil) } @@ -171,11 +111,9 @@ func (mw *Middleware) ObjectCreateBookmark(cctx context.Context, req *pb.RpcObje return response(pb.RpcObjectCreateBookmarkResponseError_UNKNOWN_ERROR, "", newDetails, err) } if req.WithChat { - _, err = mw.addChat(cctx, id) - if err != nil { - return response(pb.RpcObjectCreateBookmarkResponseError_UNKNOWN_ERROR, "", newDetails, err) - } + return response(pb.RpcObjectCreateBookmarkResponseError_UNKNOWN_ERROR, "", nil, fmt.Errorf("WithChat is not implemented")) } + return response(pb.RpcObjectCreateBookmarkResponseError_NULL, id, newDetails, nil) } @@ -276,11 +214,9 @@ func (mw *Middleware) ObjectCreateFromUrl(cctx context.Context, req *pb.RpcObjec if err != nil { return response(pb.RpcObjectCreateFromUrlResponseError_UNKNOWN_ERROR, "", err, nil) } + if req.WithChat { - _, err = mw.addChat(cctx, id) - if err != nil { - return response(pb.RpcObjectCreateFromUrlResponseError_UNKNOWN_ERROR, "", err, nil) - } + return response(pb.RpcObjectCreateFromUrlResponseError_UNKNOWN_ERROR, "", fmt.Errorf("WithChat is not implemented"), nil) } return response(pb.RpcObjectCreateFromUrlResponseError_NULL, id, nil, newDetails) } diff --git a/core/files/file.go b/core/files/file.go index ff0f88736f..e4176bf19a 100644 --- a/core/files/file.go +++ b/core/files/file.go @@ -61,7 +61,7 @@ func (f *file) audioDetails(ctx context.Context) (*types.Struct, error) { d.Fields[bundle.RelationKeyAudioAlbum.String()] = pbtypes.String(t.Album()) } if t.Artist() != "" { - d.Fields[bundle.RelationKeyAudioArtist.String()] = pbtypes.String(t.Artist()) + d.Fields[bundle.RelationKeyArtist.String()] = pbtypes.String(t.Artist()) } if t.Genre() != "" { d.Fields[bundle.RelationKeyAudioGenre.String()] = pbtypes.String(t.Genre()) diff --git a/core/files/fileobject/migration_test.go b/core/files/fileobject/migration_test.go index f50cd07ef2..144891cb16 100644 --- a/core/files/fileobject/migration_test.go +++ b/core/files/fileobject/migration_test.go @@ -206,7 +206,7 @@ func TestMigrateIds(t *testing.T) { bb.ID(objectId), ), ) - st.SetDetailAndBundledRelation(bundle.RelationKeyAttachments, pbtypes.StringList([]string{fileId.String()})) + st.SetDetailAndBundledRelation(bundle.RelationKeyIconImage, pbtypes.StringList([]string{fileId.String()})) space := mock_clientspace.NewMockSpace(t) space.EXPECT().IsPersonal().Return(true) @@ -227,7 +227,7 @@ func TestMigrateIds(t *testing.T) { bb.ID(objectId), ), ) - wantState.SetDetailAndBundledRelation(bundle.RelationKeyAttachments, pbtypes.StringList([]string{fileId.String()})) + wantState.SetDetailAndBundledRelation(bundle.RelationKeyIconImage, pbtypes.StringList([]string{fileId.String()})) bb.AssertTreesEqual(t, wantState.Blocks(), st.Blocks()) assert.Equal(t, wantState.Details(), st.Details()) diff --git a/core/indexer/reindex.go b/core/indexer/reindex.go index 54c9b46389..6cb6628bdb 100644 --- a/core/indexer/reindex.go +++ b/core/indexer/reindex.go @@ -46,6 +46,9 @@ const ( // ForceLinksReindexCounter forces to erase links from store and reindex them ForceLinksReindexCounter int32 = 1 + + // ForceMarketplaceReindex forces to do reindex only for marketplace space + ForceMarketplaceReindex int32 = 1 ) func (i *indexer) buildFlags(spaceID string) (reindexFlags, error) { @@ -112,6 +115,9 @@ func (i *indexer) buildFlags(spaceID string) (reindexFlags, error) { if checksums.LinksErase != ForceLinksReindexCounter { flags.eraseLinks = true } + if spaceID == addr.AnytypeMarketplaceWorkspace && checksums.MarketplaceForceReindexCounter != ForceMarketplaceReindex { + flags.enableAll() + } return flags, nil } @@ -525,8 +531,8 @@ func (i *indexer) reindexIdsIgnoreErr(ctx context.Context, space smartblock.Spac return } -func (i *indexer) getLatestChecksums() model.ObjectStoreChecksums { - return model.ObjectStoreChecksums{ +func (i *indexer) getLatestChecksums(isMarketplace bool) (checksums model.ObjectStoreChecksums) { + checksums = model.ObjectStoreChecksums{ BundledObjectTypes: bundle.TypeChecksum, BundledRelations: bundle.RelationChecksum, BundledTemplates: i.btHash.Hash(), @@ -539,10 +545,14 @@ func (i *indexer) getLatestChecksums() model.ObjectStoreChecksums { AreDeletedObjectsReindexed: true, LinksErase: ForceLinksReindexCounter, } + if isMarketplace { + checksums.MarketplaceForceReindexCounter = ForceMarketplaceReindex + } + return } func (i *indexer) saveLatestChecksums(spaceID string) error { - checksums := i.getLatestChecksums() + checksums := i.getLatestChecksums(spaceID == addr.AnytypeMarketplaceWorkspace) return i.store.SaveChecksums(spaceID, &checksums) } diff --git a/core/indexer/reindex_test.go b/core/indexer/reindex_test.go index fcd8f4e599..87c6aec498 100644 --- a/core/indexer/reindex_test.go +++ b/core/indexer/reindex_test.go @@ -6,6 +6,7 @@ import ( "github.com/anyproto/any-sync/commonspace/spacestorage" "github.com/anyproto/any-sync/commonspace/spacestorage/mock_spacestorage" + "github.com/gogo/protobuf/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -15,6 +16,7 @@ import ( "github.com/anyproto/anytype-heart/core/block/editor/smartblock/smarttest" "github.com/anyproto/anytype-heart/core/block/object/objectcache/mock_objectcache" "github.com/anyproto/anytype-heart/core/block/source" + "github.com/anyproto/anytype-heart/core/domain" "github.com/anyproto/anytype-heart/pb" "github.com/anyproto/anytype-heart/pkg/lib/bundle" coresb "github.com/anyproto/anytype-heart/pkg/lib/core/smartblock" @@ -29,7 +31,7 @@ import ( ) func TestReindexMarketplaceSpace(t *testing.T) { - spaceId := "market" + spaceId := addr.AnytypeMarketplaceWorkspace getMockSpace := func(fx *IndexerFixture) *clientspace.VirtualSpace { virtualSpace := clientspace.NewVirtualSpace(spaceId, clientspace.VirtualSpaceDeps{ Indexer: fx, @@ -50,7 +52,7 @@ func TestReindexMarketplaceSpace(t *testing.T) { t.Run("reindex missing object", func(t *testing.T) { // given indexerFx := NewIndexerFixture(t) - checksums := indexerFx.getLatestChecksums() + checksums := indexerFx.getLatestChecksums(true) err := indexerFx.store.SaveChecksums(spaceId, &checksums) assert.Nil(t, err) @@ -86,7 +88,7 @@ func TestReindexMarketplaceSpace(t *testing.T) { archiveLinks, err := fx.store.GetOutboundLinksByID("bin") require.Equal(t, trash, archiveLinks) - checksums := fx.getLatestChecksums() + checksums := fx.getLatestChecksums(true) checksums.LinksErase = checksums.LinksErase - 1 err = fx.objectStore.SaveChecksums(spaceId, &checksums) @@ -112,6 +114,37 @@ func TestReindexMarketplaceSpace(t *testing.T) { storeChecksums, err := fx.store.GetChecksums(spaceId) assert.Equal(t, ForceLinksReindexCounter, storeChecksums.LinksErase) }) + + t.Run("full marketplace reindex on force flag update", func(t *testing.T) { + // given + fx := NewIndexerFixture(t) + fx.objectStore.AddObjects(t, []objectstore.TestObject{map[domain.RelationKey]*types.Value{ + bundle.RelationKeyId: pbtypes.String("relationThatWillBeDeleted"), + bundle.RelationKeyName: pbtypes.String("Relation-That-Will-Be-Deleted"), + bundle.RelationKeySpaceId: pbtypes.String(spaceId), + }}) + + checksums := fx.getLatestChecksums(true) + checksums.MarketplaceForceReindexCounter = checksums.MarketplaceForceReindexCounter - 1 + + err := fx.objectStore.SaveChecksums(spaceId, &checksums) + require.NoError(t, err) + + storage := mock_storage.NewMockClientStorage(t) + storage.EXPECT().BindSpaceID(mock.Anything, mock.Anything).Return(nil) + fx.storageService = storage + + fx.sourceFx.EXPECT().IDsListerBySmartblockType(mock.Anything, mock.Anything).Return(idsLister{Ids: []string{}}, nil).Maybe() + + // when + err = fx.ReindexMarketplaceSpace(getMockSpace(fx)) + assert.NoError(t, err) + + // then + det, err := fx.store.GetDetails("relationThatWillBeDeleted") + assert.NoError(t, err) + assert.Empty(t, det.Details.Fields) + }) } func TestReindexDeletedObjects(t *testing.T) { @@ -141,7 +174,7 @@ func TestReindexDeletedObjects(t *testing.T) { }, }) - checksums := fx.getLatestChecksums() + checksums := fx.getLatestChecksums(false) checksums.AreDeletedObjectsReindexed = false err := fx.objectStore.SaveChecksums(spaceId1, &checksums) @@ -248,7 +281,7 @@ func TestIndexer_ReindexSpace_EraseLinks(t *testing.T) { }, }) - checksums := fx.getLatestChecksums() + checksums := fx.getLatestChecksums(false) checksums.LinksErase = checksums.LinksErase - 1 err := fx.objectStore.SaveChecksums(spaceId1, &checksums) diff --git a/core/subscription/group_test.go b/core/subscription/group_test.go index 4018ddfba7..b171d605a7 100644 --- a/core/subscription/group_test.go +++ b/core/subscription/group_test.go @@ -6,6 +6,7 @@ import ( "github.com/gogo/protobuf/types" "github.com/stretchr/testify/require" "github.com/valyala/fastjson" + "golang.org/x/text/collate" "github.com/anyproto/anytype-heart/core/kanban" "github.com/anyproto/anytype-heart/pkg/lib/bundle" @@ -62,7 +63,7 @@ func TestGroupTag(t *testing.T) { q := database.Query{} - f, err := database.NewFilters(q, database.NewMockObjectStore(t), &fastjson.Arena{}) + f, err := database.NewFilters(q, database.NewMockObjectStore(t), &fastjson.Arena{}, &collate.Buffer{}) require.NoError(t, err) filterTag := database.FilterNot{Filter: database.FilterEmpty{Key: kanbanKey}} f.FilterObj = database.FiltersAnd{f.FilterObj, filterTag} diff --git a/core/subscription/service.go b/core/subscription/service.go index 6276e32705..5452bf265a 100644 --- a/core/subscription/service.go +++ b/core/subscription/service.go @@ -14,6 +14,7 @@ import ( "github.com/gogo/protobuf/types" "github.com/valyala/fastjson" "golang.org/x/exp/slices" + "golang.org/x/text/collate" "github.com/anyproto/anytype-heart/core/domain" @@ -190,7 +191,7 @@ func (s *service) Search(req SubscribeRequest) (*SubscribeResponse, error) { arena := s.arenaPool.Get() defer s.arenaPool.Put(arena) - f, err := database.NewFilters(q, s.objectStore, arena) + f, err := database.NewFilters(q, s.objectStore, arena, &collate.Buffer{}) if err != nil { return nil, fmt.Errorf("new database filters: %w", err) } @@ -401,7 +402,7 @@ func (s *service) SubscribeGroups(ctx session.Context, req pb.RpcObjectGroupsSub arena := s.arenaPool.Get() defer s.arenaPool.Put(arena) - flt, err := database.NewFilters(q, s.objectStore, arena) + flt, err := database.NewFilters(q, s.objectStore, arena, &collate.Buffer{}) if err != nil { return nil, err } diff --git a/docs/UsecaseValidator.md b/docs/UsecaseValidator.md index 95935c26a1..989be479d6 100644 --- a/docs/UsecaseValidator.md +++ b/docs/UsecaseValidator.md @@ -1,6 +1,6 @@ ## Use Case archives validation tool -To use Use Case archives validation tool head to [cmd/usecasevalidator](../cmd/usecasegenerator), build the program +To use Use Case archives validation tool head to [cmd/usecasevalidator](../cmd/usecasevalidator), build the program `go build` and run it using `./usecasevalidator -path ` @@ -90,4 +90,4 @@ To choose the desired action **action** field should be provided to the JSON obj } ``` -More examples could be found in **rules.json** file \ No newline at end of file +More examples could be found in **rules.json** file diff --git a/docs/proto.md b/docs/proto.md index 577b2e759c..4fb75d314e 100644 --- a/docs/proto.md +++ b/docs/proto.md @@ -27041,6 +27041,7 @@ Precondition: user A and user B opened the same block | areOldFilesRemoved | [bool](#bool) | | | | areDeletedObjectsReindexed | [bool](#bool) | | | | linksErase | [int32](#int32) | | | +| marketplaceForceReindexCounter | [int32](#int32) | | | diff --git a/go.mod b/go.mod index 8662090c0f..c2a2601ac1 100644 --- a/go.mod +++ b/go.mod @@ -77,7 +77,7 @@ require ( github.com/otiai10/copy v1.14.0 github.com/otiai10/opengraph/v2 v2.1.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.20.2 + github.com/prometheus/client_golang v1.20.3 github.com/pseudomuto/protoc-gen-doc v1.5.1 github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd github.com/samber/lo v1.47.0 @@ -95,11 +95,11 @@ require ( go.uber.org/multierr v1.11.0 go.uber.org/zap v1.27.0 golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 - golang.org/x/image v0.19.0 + golang.org/x/image v0.20.0 golang.org/x/mobile v0.0.0-20240806205939-81131f6468ab - golang.org/x/net v0.28.0 - golang.org/x/oauth2 v0.22.0 - golang.org/x/text v0.17.0 + golang.org/x/net v0.29.0 + golang.org/x/oauth2 v0.23.0 + golang.org/x/text v0.18.0 google.golang.org/grpc v1.66.0 gopkg.in/Graylog2/go-gelf.v2 v2.0.0-20180125164251-1832d8546a9f gopkg.in/yaml.v3 v3.0.1 @@ -262,11 +262,11 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/otel v1.14.0 // indirect go.opentelemetry.io/otel/trace v1.14.0 // indirect - golang.org/x/crypto v0.26.0 // indirect + golang.org/x/crypto v0.27.0 // indirect golang.org/x/mod v0.20.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/term v0.23.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.24.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240604185151-ef581f913117 // indirect diff --git a/go.sum b/go.sum index ecb9a63ce3..e9c3ed8266 100644 --- a/go.sum +++ b/go.sum @@ -1224,8 +1224,8 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.20.2 h1:5ctymQzZlyOON1666svgwn3s6IKWgfbjsejTMiXIyjg= -github.com/prometheus/client_golang v1.20.2/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= +github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1522,8 +1522,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1544,8 +1544,8 @@ golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86h golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.19.0 h1:D9FX4QWkLfkeqaC62SonffIIuYdOk/UE2XKUBgRIBIQ= -golang.org/x/image v0.19.0/go.mod h1:y0zrRqlQRWQ5PXaYCOMLTW2fpsxZ8Qh9I/ohnInJEys= +golang.org/x/image v0.20.0 h1:7cVCUjQwfL18gyBJOmYvptfSHS8Fb3YUDtfLIZ7Nbpw= +golang.org/x/image v0.20.0/go.mod h1:0a88To4CYVBAHp5FXJm8o7QbUl37Vd85ply1vyD8auM= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1637,8 +1637,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1648,8 +1648,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1758,8 +1758,8 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1767,8 +1767,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1780,8 +1780,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/pkg/lib/bundle/relation.gen.go b/pkg/lib/bundle/relation.gen.go index abb78a871b..a1c526198d 100644 --- a/pkg/lib/bundle/relation.gen.go +++ b/pkg/lib/bundle/relation.gen.go @@ -9,7 +9,7 @@ import ( "github.com/anyproto/anytype-heart/pkg/lib/pb/model" ) -const RelationChecksum = "fbd6b6c23b4acf4691622d3a124564159191a9e9a7d129ab81b66a3f22e3fce2" +const RelationChecksum = "078d262c57d5afa7a4e33112c47c669d317041275850df66fb75f7ab6a7a9e6c" const ( RelationKeyTag domain.RelationKey = "tag" RelationKeyCamera domain.RelationKey = "camera" @@ -20,132 +20,86 @@ const ( RelationKeyRelationKey domain.RelationKey = "relationKey" RelationKeyRelationOptionColor domain.RelationKey = "relationOptionColor" RelationKeyLatestAclHeadId domain.RelationKey = "latestAclHeadId" - RelationKeyInstructions domain.RelationKey = "instructions" RelationKeyDone domain.RelationKey = "done" RelationKeyMediaArtistURL domain.RelationKey = "mediaArtistURL" RelationKeyTemplateIsBundled domain.RelationKey = "templateIsBundled" - RelationKeyDateOfBirth domain.RelationKey = "dateOfBirth" RelationKeyRestrictions domain.RelationKey = "restrictions" RelationKeyReadersLimit domain.RelationKey = "readersLimit" RelationKeyWritersLimit domain.RelationKey = "writersLimit" RelationKeySharedSpacesLimit domain.RelationKey = "sharedSpacesLimit" RelationKeyIsHighlighted domain.RelationKey = "isHighlighted" - RelationKeyThumbnailImage domain.RelationKey = "thumbnailImage" - RelationKeyAttachments domain.RelationKey = "attachments" - RelationKeyAudioArtist domain.RelationKey = "audioArtist" RelationKeyTasks domain.RelationKey = "tasks" RelationKeySnippet domain.RelationKey = "snippet" - RelationKeyHypothesisAssumptions domain.RelationKey = "hypothesisAssumptions" RelationKeyRelationFormat domain.RelationKey = "relationFormat" RelationKeyRelationReadonlyValue domain.RelationKey = "relationReadonlyValue" RelationKeyIconImage domain.RelationKey = "iconImage" RelationKeyIngredients domain.RelationKey = "ingredients" RelationKeyGenre domain.RelationKey = "genre" - RelationKeySolution domain.RelationKey = "solution" RelationKeyReleasedYear domain.RelationKey = "releasedYear" RelationKeyCoverScale domain.RelationKey = "coverScale" - RelationKeyTwitter domain.RelationKey = "twitter" - RelationKeyUserStories domain.RelationKey = "userStories" RelationKeyRelationDefaultValue domain.RelationKey = "relationDefaultValue" RelationKeyLinkedProjects domain.RelationKey = "linkedProjects" RelationKeyAudioAlbum domain.RelationKey = "audioAlbum" - RelationKeyProblem domain.RelationKey = "problem" RelationKeyLayoutAlign domain.RelationKey = "layoutAlign" - RelationKeyClass domain.RelationKey = "class" - RelationKeyDifficulty domain.RelationKey = "difficulty" - RelationKeyDirector domain.RelationKey = "director" RelationKeyStatus domain.RelationKey = "status" - RelationKeyLogic domain.RelationKey = "logic" - RelationKeyAlternative domain.RelationKey = "alternative" - RelationKeyLinkedContacts domain.RelationKey = "linkedContacts" - RelationKeyRottenTomatoesRating domain.RelationKey = "rottenTomatoesRating" RelationKeyIsHidden domain.RelationKey = "isHidden" RelationKeyIsHiddenDiscovery domain.RelationKey = "isHiddenDiscovery" - RelationKeyAdditional domain.RelationKey = "additional" - RelationKeyBudget domain.RelationKey = "budget" RelationKeyMediaArtistName domain.RelationKey = "mediaArtistName" - RelationKeyRating domain.RelationKey = "rating" RelationKeyEmail domain.RelationKey = "email" RelationKeyCompany domain.RelationKey = "company" RelationKeyAperture domain.RelationKey = "aperture" RelationKeyLastModifiedDate domain.RelationKey = "lastModifiedDate" - RelationKeyStakeholders domain.RelationKey = "stakeholders" - RelationKeyMeasureOfSuccess domain.RelationKey = "measureOfSuccess" RelationKeyRecommendedRelations domain.RelationKey = "recommendedRelations" RelationKeyCreator domain.RelationKey = "creator" RelationKeyRecommendedLayout domain.RelationKey = "recommendedLayout" - RelationKeyResult domain.RelationKey = "result" - RelationKeyReflection domain.RelationKey = "reflection" RelationKeyLastOpenedDate domain.RelationKey = "lastOpenedDate" RelationKeyAuthor domain.RelationKey = "author" RelationKeyArtist domain.RelationKey = "artist" RelationKeyDueDate domain.RelationKey = "dueDate" - RelationKeyRecords domain.RelationKey = "records" RelationKeyIconEmoji domain.RelationKey = "iconEmoji" RelationKeyCoverType domain.RelationKey = "coverType" RelationKeyCoverY domain.RelationKey = "coverY" RelationKeyTime domain.RelationKey = "time" RelationKeySizeInBytes domain.RelationKey = "sizeInBytes" RelationKeyCollectionOf domain.RelationKey = "collectionOf" - RelationKeyEvents domain.RelationKey = "events" - RelationKeyTimeframe domain.RelationKey = "timeframe" RelationKeyIsReadonly domain.RelationKey = "isReadonly" RelationKeyAddedDate domain.RelationKey = "addedDate" RelationKeyAssignee domain.RelationKey = "assignee" RelationKeyExposure domain.RelationKey = "exposure" RelationKeyTargetObjectType domain.RelationKey = "targetObjectType" - RelationKeyMaterials domain.RelationKey = "materials" RelationKeyIsFavorite domain.RelationKey = "isFavorite" - RelationKeyStars domain.RelationKey = "stars" RelationKeyWorkspaceId domain.RelationKey = "workspaceId" RelationKeySpaceId domain.RelationKey = "spaceId" RelationKeyAudioGenre domain.RelationKey = "audioGenre" - RelationKeyTelegram domain.RelationKey = "telegram" - RelationKeyTrailer domain.RelationKey = "trailer" RelationKeyName domain.RelationKey = "name" RelationKeyMood domain.RelationKey = "mood" RelationKeyAudioLyrics domain.RelationKey = "audioLyrics" - RelationKeyInstagram domain.RelationKey = "instagram" - RelationKeyClassType domain.RelationKey = "classType" - RelationKeyHowToReproduce domain.RelationKey = "howToReproduce" RelationKeyFocalRatio domain.RelationKey = "focalRatio" RelationKeyPriority domain.RelationKey = "priority" RelationKeyFileMimeType domain.RelationKey = "fileMimeType" RelationKeyType domain.RelationKey = "type" RelationKeyLayout domain.RelationKey = "layout" RelationKeyAudioAlbumTrackNumber domain.RelationKey = "audioAlbumTrackNumber" - RelationKeyPlaceOfBirth domain.RelationKey = "placeOfBirth" - RelationKeyComposer domain.RelationKey = "composer" RelationKeyInternalFlags domain.RelationKey = "internalFlags" - RelationKeySocialProfile domain.RelationKey = "socialProfile" - RelationKeyOccupation domain.RelationKey = "occupation" RelationKeyCoverX domain.RelationKey = "coverX" RelationKeyDescription domain.RelationKey = "description" - RelationKeyFacebook domain.RelationKey = "facebook" RelationKeyPicture domain.RelationKey = "picture" RelationKeyId domain.RelationKey = "id" RelationKeyUrl domain.RelationKey = "url" - RelationKeyObjectives domain.RelationKey = "objectives" RelationKeyCameraIso domain.RelationKey = "cameraIso" RelationKeyIsDeleted domain.RelationKey = "isDeleted" RelationKeyLinks domain.RelationKey = "links" - RelationKeyServings domain.RelationKey = "servings" - RelationKeyCategory domain.RelationKey = "category" RelationKeyCoverId domain.RelationKey = "coverId" RelationKeyLastModifiedBy domain.RelationKey = "lastModifiedBy" RelationKeyRelationMaxCount domain.RelationKey = "relationMaxCount" - RelationKeyQuestions domain.RelationKey = "questions" RelationKeyWidthInPixels domain.RelationKey = "widthInPixels" RelationKeyProgress domain.RelationKey = "progress" RelationKeySetOf domain.RelationKey = "setOf" - RelationKeyGender domain.RelationKey = "gender" RelationKeyIsArchived domain.RelationKey = "isArchived" RelationKeyFileExt domain.RelationKey = "fileExt" RelationKeyScope domain.RelationKey = "scope" - RelationKeyJob domain.RelationKey = "job" RelationKeyFeaturedRelations domain.RelationKey = "featuredRelations" RelationKeyPhone domain.RelationKey = "phone" - RelationKeyImdbRating domain.RelationKey = "imdbRating" RelationKeySmartblockTypes domain.RelationKey = "smartblockTypes" RelationKeySource domain.RelationKey = "source" RelationKeySourceObject domain.RelationKey = "sourceObject" @@ -189,6 +143,7 @@ const ( RelationKeySyncError domain.RelationKey = "syncError" RelationKeyHasChat domain.RelationKey = "hasChat" RelationKeyChatId domain.RelationKey = "chatId" + RelationKeyMentions domain.RelationKey = "mentions" ) var ( @@ -206,32 +161,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyAdditional: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_bradditional", - Key: "additional", - MaxCount: 1, - Name: "Additional", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeyAlternative: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_bralternative", - Key: "alternative", - MaxCount: 1, - Name: "Alternative", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyAperture: { DataSource: model.Relation_details, @@ -272,19 +201,6 @@ var ( Revision: 1, Scope: model.Relation_type, }, - RelationKeyAttachments: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_file, - Id: "_brattachments", - Key: "attachments", - Name: "Attachments", - ObjectTypes: []string{TypePrefix + "file", TypePrefix + "image", TypePrefix + "video", TypePrefix + "audio"}, - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyAudioAlbum: { DataSource: model.Relation_details, @@ -311,19 +227,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyAudioArtist: { - - DataSource: model.Relation_details, - Description: "The artist that performed this album or recording", - Format: model.RelationFormat_longtext, - Id: "_braudioArtist", - Key: "audioArtist", - MaxCount: 1, - Name: "Recording Artist", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyAudioGenre: { DataSource: model.Relation_details, @@ -377,19 +280,6 @@ var ( Revision: 3, Scope: model.Relation_type, }, - RelationKeyBudget: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_number, - Id: "_brbudget", - Key: "budget", - MaxCount: 1, - Name: "Budget", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyCamera: { DataSource: model.Relation_details, @@ -416,18 +306,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyCategory: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_tag, - Id: "_brcategory", - Key: "category", - Name: "Category", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyChatId: { DataSource: model.Relation_derived, @@ -442,30 +320,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyClass: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_object, - Id: "_brclass", - Key: "class", - Name: "Class", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeyClassType: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_tag, - Id: "_brclassType", - Key: "classType", - Name: "Class type", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyCollectionOf: { DataSource: model.Relation_details, @@ -492,19 +346,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyComposer: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brcomposer", - Key: "composer", - MaxCount: 1, - Name: "Composer", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyCoverId: { DataSource: model.Relation_details, @@ -602,19 +443,6 @@ var ( Revision: 1, Scope: model.Relation_type, }, - RelationKeyDateOfBirth: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_date, - Id: "_brdateOfBirth", - Key: "dateOfBirth", - MaxCount: 1, - Name: "Birthday", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyDefaultTemplateId: { DataSource: model.Relation_details, @@ -642,31 +470,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyDifficulty: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_number, - Id: "_brdifficulty", - Key: "difficulty", - MaxCount: 1, - Name: "Difficulty", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeyDirector: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_object, - Id: "_brdirector", - Key: "director", - Name: "Director", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyDone: { DataSource: model.Relation_details, @@ -707,18 +510,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyEvents: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_object, - Id: "_brevents", - Key: "events", - Name: "Events", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyExposure: { DataSource: model.Relation_details, @@ -732,19 +523,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyFacebook: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_url, - Id: "_brfacebook", - Key: "facebook", - MaxCount: 1, - Name: "Facebook", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyFeaturedRelations: { DataSource: model.Relation_details, @@ -854,19 +632,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyGender: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_status, - Id: "_brgender", - Key: "gender", - MaxCount: 1, - Name: "Gender", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyGenre: { DataSource: model.Relation_details, @@ -919,32 +684,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyHowToReproduce: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brhowToReproduce", - Key: "howToReproduce", - MaxCount: 1, - Name: "How-to reproduce", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeyHypothesisAssumptions: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brhypothesisAssumptions", - Key: "hypothesisAssumptions", - MaxCount: 1, - Name: "Hypothesis & assumptions", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyIconEmoji: { DataSource: model.Relation_details, @@ -1044,19 +783,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyImdbRating: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_number, - Id: "_brimdbRating", - Key: "imdbRating", - MaxCount: 1, - Name: "IMDb rating", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyImportType: { DataSource: model.Relation_details, @@ -1083,32 +809,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyInstagram: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_url, - Id: "_brinstagram", - Key: "instagram", - MaxCount: 1, - Name: "Instagram", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeyInstructions: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brinstructions", - Key: "instructions", - MaxCount: 1, - Name: "Instructions", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyInternalFlags: { DataSource: model.Relation_details, @@ -1248,19 +948,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyJob: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brjob", - Key: "job", - MaxCount: 1, - Name: "Job", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyLastChangeId: { DataSource: model.Relation_derived, @@ -1372,18 +1059,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyLinkedContacts: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_object, - Id: "_brlinkedContacts", - Key: "linkedContacts", - Name: "Linked Contacts", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyLinkedProjects: { DataSource: model.Relation_details, @@ -1410,45 +1085,6 @@ var ( Revision: 3, Scope: model.Relation_type, }, - RelationKeyLogic: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brlogic", - Key: "logic", - MaxCount: 1, - Name: "Logic", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeyMaterials: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brmaterials", - Key: "materials", - MaxCount: 1, - Name: "Materials", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeyMeasureOfSuccess: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brmeasureOfSuccess", - Key: "measureOfSuccess", - MaxCount: 1, - Name: "Measure of success", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyMediaArtistName: { DataSource: model.Relation_details, @@ -1477,6 +1113,19 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, + RelationKeyMentions: { + + DataSource: model.Relation_local, + Description: "Objects that are mentioned in blocks of this object", + Format: model.RelationFormat_object, + Hidden: true, + Id: "_brmentions", + Key: "mentions", + Name: "Mentions", + ReadOnly: true, + ReadOnlyRelation: true, + Scope: model.Relation_type, + }, RelationKeyMood: { DataSource: model.Relation_details, @@ -1503,32 +1152,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyObjectives: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brobjectives", - Key: "objectives", - MaxCount: 1, - Name: "Objectives", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeyOccupation: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_broccupation", - Key: "occupation", - MaxCount: 1, - Name: "Occupation", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyOldAnytypeID: { DataSource: model.Relation_details, @@ -1612,19 +1235,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyPlaceOfBirth: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brplaceOfBirth", - Key: "placeOfBirth", - MaxCount: 1, - Name: "Place of birth", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyPriority: { DataSource: model.Relation_details, @@ -1638,19 +1248,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyProblem: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brproblem", - Key: "problem", - MaxCount: 1, - Name: "Problem", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyProfileOwnerIdentity: { DataSource: model.Relation_derived, @@ -1677,32 +1274,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyQuestions: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brquestions", - Key: "questions", - MaxCount: 1, - Name: "Questions", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeyRating: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brrating", - Key: "rating", - MaxCount: 1, - Name: "Rating", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyReadersLimit: { DataSource: model.Relation_derived, @@ -1745,32 +1316,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyRecords: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brrecords", - Key: "records", - MaxCount: 1, - Name: "Records", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeyReflection: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_checkbox, - Id: "_brreflection", - Key: "reflection", - MaxCount: 1, - Name: "Reflection", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyRelationDefaultValue: { DataSource: model.Relation_details, @@ -1892,19 +1437,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyResult: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brresult", - Key: "result", - MaxCount: 1, - Name: "Result", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyRevision: { DataSource: model.Relation_details, @@ -1919,19 +1451,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyRottenTomatoesRating: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_number, - Id: "_brrottenTomatoesRating", - Key: "rottenTomatoesRating", - MaxCount: 1, - Name: "Rotten Tomatoes rating", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyScope: { DataSource: model.Relation_details, @@ -1945,19 +1464,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyServings: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_number, - Id: "_brservings", - Key: "servings", - MaxCount: 1, - Name: "Servings", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeySetOf: { DataSource: model.Relation_details, @@ -2025,32 +1531,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeySocialProfile: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_url, - Id: "_brsocialProfile", - Key: "socialProfile", - MaxCount: 1, - Name: "Profile in social media", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeySolution: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brsolution", - Key: "solution", - MaxCount: 1, - Name: "Solution", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeySource: { DataSource: model.Relation_details, @@ -2232,18 +1712,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyStakeholders: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_object, - Id: "_brstakeholders", - Key: "stakeholders", - Name: "Stakeholders", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyStarred: { DataSource: model.Relation_details, @@ -2257,18 +1725,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyStars: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_object, - Id: "_brstars", - Key: "stars", - Name: "Stars", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyStatus: { DataSource: model.Relation_details, @@ -2378,19 +1834,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyTelegram: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_url, - Id: "_brtelegram", - Key: "telegram", - MaxCount: 1, - Name: "Telegram", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyTemplateIsBundled: { DataSource: model.Relation_derived, @@ -2405,19 +1848,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyThumbnailImage: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_file, - Id: "_brthumbnailImage", - Key: "thumbnailImage", - Name: "Thumbnail image", - ObjectTypes: []string{TypePrefix + "image"}, - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyTime: { DataSource: model.Relation_details, @@ -2431,19 +1861,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyTimeframe: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_brtimeframe", - Key: "timeframe", - MaxCount: 1, - Name: "Timeframe", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyToBeDeletedDate: { DataSource: model.Relation_account, @@ -2453,37 +1870,11 @@ var ( Id: "_brtoBeDeletedDate", Key: "toBeDeletedDate", MaxCount: 1, - Name: "Date toderived delete", + Name: "Date to delete", ReadOnly: true, ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyTrailer: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_file, - Id: "_brtrailer", - Key: "trailer", - Name: "Trailer", - ObjectTypes: []string{TypePrefix + "file", TypePrefix + "image", TypePrefix + "video", TypePrefix + "audio"}, - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, - RelationKeyTwitter: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_url, - Id: "_brtwitter", - Key: "twitter", - MaxCount: 1, - Name: "Twitter", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyType: { DataSource: model.Relation_derived, @@ -2525,19 +1916,6 @@ var ( ReadOnlyRelation: true, Scope: model.Relation_type, }, - RelationKeyUserStories: { - - DataSource: model.Relation_details, - Description: "", - Format: model.RelationFormat_longtext, - Id: "_bruserStories", - Key: "userStories", - MaxCount: 1, - Name: "User stories", - ReadOnly: false, - ReadOnlyRelation: true, - Scope: model.Relation_type, - }, RelationKeyWidthInPixels: { DataSource: model.Relation_details, diff --git a/pkg/lib/bundle/relations.json b/pkg/lib/bundle/relations.json index 138fa627da..0ec7c0c5d5 100644 --- a/pkg/lib/bundle/relations.json +++ b/pkg/lib/bundle/relations.json @@ -44,7 +44,7 @@ "hidden": true, "key": "toBeDeletedDate", "maxCount": 1, - "name": "Date toderived delete", + "name": "Date to delete", "readonly": true, "source": "account" }, @@ -88,15 +88,6 @@ "readonly": true, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "instructions", - "maxCount": 1, - "name": "Instructions", - "readonly": false, - "source": "details" - }, { "description": "Done checkbox used to render action layout. ", "format": "checkbox", @@ -127,15 +118,6 @@ "readonly": true, "source": "derived" }, - { - "format": "date", - "hidden": false, - "key": "dateOfBirth", - "maxCount": 1, - "name": "Birthday", - "readonly": false, - "source": "details" - }, { "description": "Object restrictions list", "format": "number", @@ -186,43 +168,6 @@ "readonly": false, "source": "account" }, - { - "format": "file", - "hidden": false, - "key": "thumbnailImage", - "maxCount": 0, - "name": "Thumbnail image", - "objectTypes": [ - "image" - ], - "readonly": false, - "source": "details" - }, - { - "format": "file", - "hidden": false, - "key": "attachments", - "maxCount": 0, - "name": "Attachments", - "objectTypes": [ - "file", - "image", - "video", - "audio" - ], - "readonly": false, - "source": "details" - }, - { - "description": "The artist that performed this album or recording", - "format": "longtext", - "hidden": false, - "key": "audioArtist", - "maxCount": 1, - "name": "Recording Artist", - "readonly": false, - "source": "details" - }, { "description": "List of related tasks\n", "format": "object", @@ -246,15 +191,6 @@ "readonly": true, "source": "derived" }, - { - "format": "longtext", - "hidden": false, - "key": "hypothesisAssumptions", - "maxCount": 1, - "name": "Hypothesis & assumptions", - "readonly": false, - "source": "details" - }, { "description": "Type of the underlying value", "format": "number", @@ -306,15 +242,6 @@ "readonly": false, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "solution", - "maxCount": 1, - "name": "Solution", - "readonly": false, - "source": "details" - }, { "description": "Year when this object were released", "format": "number", @@ -335,24 +262,6 @@ "readonly": false, "source": "details" }, - { - "format": "url", - "hidden": false, - "key": "twitter", - "maxCount": 1, - "name": "Twitter", - "readonly": false, - "source": "details" - }, - { - "format": "longtext", - "hidden": false, - "key": "userStories", - "maxCount": 1, - "name": "User stories", - "readonly": false, - "source": "details" - }, { "format": "longtext", "hidden": false, @@ -384,15 +293,6 @@ "readonly": false, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "problem", - "maxCount": 1, - "name": "Problem", - "readonly": false, - "source": "details" - }, { "description": "Specify visual align of the layout", "format": "number", @@ -403,33 +303,6 @@ "readonly": false, "source": "details" }, - { - "format": "object", - "hidden": false, - "key": "class", - "maxCount": 0, - "name": "Class", - "readonly": false, - "source": "details" - }, - { - "format": "number", - "hidden": false, - "key": "difficulty", - "maxCount": 1, - "name": "Difficulty", - "readonly": false, - "source": "details" - }, - { - "format": "object", - "hidden": false, - "key": "director", - "maxCount": 0, - "name": "Director", - "readonly": false, - "source": "details" - }, { "description": "Task status", "format": "status", @@ -440,42 +313,6 @@ "readonly": false, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "logic", - "maxCount": 1, - "name": "Logic", - "readonly": false, - "source": "details" - }, - { - "format": "longtext", - "hidden": false, - "key": "alternative", - "maxCount": 1, - "name": "Alternative", - "readonly": false, - "source": "details" - }, - { - "format": "object", - "hidden": false, - "key": "linkedContacts", - "maxCount": 0, - "name": "Linked Contacts", - "readonly": false, - "source": "details" - }, - { - "format": "number", - "hidden": false, - "key": "rottenTomatoesRating", - "maxCount": 1, - "name": "Rotten Tomatoes rating", - "readonly": false, - "source": "details" - }, { "description": "Specify if object is hidden", "format": "checkbox", @@ -496,24 +333,6 @@ "readonly": true, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "additional", - "maxCount": 1, - "name": "Additional", - "readonly": false, - "source": "details" - }, - { - "format": "number", - "hidden": false, - "key": "budget", - "maxCount": 1, - "name": "Budget", - "readonly": false, - "source": "details" - }, { "description": "Artist name", "format": "longtext", @@ -524,15 +343,6 @@ "readonly": true, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "rating", - "maxCount": 1, - "name": "Rating", - "readonly": false, - "source": "details" - }, { "format": "email", "hidden": false, @@ -570,24 +380,6 @@ "readonly": true, "source": "derived" }, - { - "format": "object", - "hidden": false, - "key": "stakeholders", - "maxCount": 0, - "name": "Stakeholders", - "readonly": false, - "source": "details" - }, - { - "format": "longtext", - "hidden": false, - "key": "measureOfSuccess", - "maxCount": 1, - "name": "Measure of success", - "readonly": false, - "source": "details" - }, { "description": "List of recommended relations", "format": "object", @@ -622,24 +414,6 @@ "readonly": false, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "result", - "maxCount": 1, - "name": "Result", - "readonly": false, - "source": "details" - }, - { - "format": "checkbox", - "hidden": false, - "key": "reflection", - "maxCount": 1, - "name": "Reflection", - "readonly": false, - "source": "details" - }, { "description": "Date when the object was modified last opened", "format": "date", @@ -684,15 +458,6 @@ "readonly": false, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "records", - "maxCount": 1, - "name": "Records", - "readonly": false, - "source": "details" - }, { "description": "1 emoji(can contains multiple UTF symbols) used as an icon", "format": "emoji", @@ -755,24 +520,6 @@ "readonly": false, "source": "details" }, - { - "format": "object", - "hidden": false, - "key": "events", - "maxCount": 0, - "name": "Events", - "readonly": false, - "source": "details" - }, - { - "format": "longtext", - "hidden": false, - "key": "timeframe", - "maxCount": 1, - "name": "Timeframe", - "readonly": false, - "source": "details" - }, { "description": "Indicates whether the object is read-only. Means it can't be edited and archived", "format": "checkbox", @@ -831,15 +578,6 @@ "readonly": false, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "materials", - "maxCount": 1, - "name": "Materials", - "readonly": false, - "source": "details" - }, { "description": "Adds the object to the home dashboard", "format": "checkbox", @@ -850,15 +588,6 @@ "readonly": false, "source": "account" }, - { - "format": "object", - "hidden": false, - "key": "stars", - "maxCount": 0, - "name": "Stars", - "readonly": false, - "source": "details" - }, { "description": "Space object belongs to", "format": "object", @@ -895,30 +624,6 @@ "readonly": false, "source": "details" }, - { - "format": "url", - "hidden": false, - "key": "telegram", - "maxCount": 1, - "name": "Telegram", - "readonly": false, - "source": "details" - }, - { - "format": "file", - "hidden": false, - "key": "trailer", - "maxCount": 0, - "name": "Trailer", - "objectTypes": [ - "file", - "image", - "video", - "audio" - ], - "readonly": false, - "source": "details" - }, { "description": "Name of the object", "format": "shorttext", @@ -948,33 +653,6 @@ "readonly": false, "source": "details" }, - { - "format": "url", - "hidden": false, - "key": "instagram", - "maxCount": 1, - "name": "Instagram", - "readonly": false, - "source": "details" - }, - { - "format": "tag", - "hidden": false, - "key": "classType", - "maxCount": 0, - "name": "Class type", - "readonly": false, - "source": "details" - }, - { - "format": "longtext", - "hidden": false, - "key": "howToReproduce", - "maxCount": 1, - "name": "How-to reproduce", - "readonly": false, - "source": "details" - }, { "format": "number", "hidden": false, @@ -1037,24 +715,6 @@ "readonly": false, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "placeOfBirth", - "maxCount": 1, - "name": "Place of birth", - "readonly": false, - "source": "details" - }, - { - "format": "longtext", - "hidden": false, - "key": "composer", - "maxCount": 1, - "name": "Composer", - "readonly": false, - "source": "details" - }, { "description": "Set of internal flags", "format": "number", @@ -1065,24 +725,6 @@ "readonly": true, "source": "details" }, - { - "format": "url", - "hidden": false, - "key": "socialProfile", - "maxCount": 1, - "name": "Profile in social media", - "readonly": false, - "source": "details" - }, - { - "format": "longtext", - "hidden": false, - "key": "occupation", - "maxCount": 1, - "name": "Occupation", - "readonly": false, - "source": "details" - }, { "description": "Image x offset of the provided image", "format": "number", @@ -1102,15 +744,6 @@ "readonly": false, "source": "details" }, - { - "format": "url", - "hidden": false, - "key": "facebook", - "maxCount": 1, - "name": "Facebook", - "readonly": false, - "source": "details" - }, { "description": "An image is an artifact that depicts visual perception, such as a photograph or other two-dimensional picture", "format": "file", @@ -1144,15 +777,6 @@ "readonly": false, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "objectives", - "maxCount": 1, - "name": "Objectives", - "readonly": false, - "source": "details" - }, { "format": "number", "hidden": false, @@ -1183,24 +807,6 @@ "source": "derived", "revision": 3 }, - { - "format": "number", - "hidden": false, - "key": "servings", - "maxCount": 1, - "name": "Servings", - "readonly": false, - "source": "details" - }, - { - "format": "tag", - "hidden": false, - "key": "category", - "maxCount": 0, - "name": "Category", - "readonly": false, - "source": "details" - }, { "description": "Can contains image hash, color or prebuild bg id, depends on coverType relation", "format": "longtext", @@ -1235,15 +841,6 @@ "readonly": false, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "questions", - "maxCount": 1, - "name": "Questions", - "readonly": false, - "source": "details" - }, { "description": "Width of image/video in pixels", "format": "number", @@ -1276,15 +873,6 @@ "readonly": true, "source": "details" }, - { - "format": "status", - "hidden": false, - "key": "gender", - "maxCount": 1, - "name": "Gender", - "readonly": false, - "source": "details" - }, { "description": "Hides the object", "format": "checkbox", @@ -1313,15 +901,6 @@ "readonly": false, "source": "details" }, - { - "format": "longtext", - "hidden": false, - "key": "job", - "maxCount": 1, - "name": "Job", - "readonly": false, - "source": "details" - }, { "description": "Important relations that always appear at the top of the object", "format": "object", @@ -1344,15 +923,6 @@ "readonly": false, "source": "details" }, - { - "format": "number", - "hidden": false, - "key": "imdbRating", - "maxCount": 1, - "name": "IMDb rating", - "readonly": false, - "source": "details" - }, { "description": "Stored for object type. Contains tge list of smartblock types used to create the object", "format": "number", @@ -1778,5 +1348,15 @@ "name": "Chat id", "readonly": true, "source": "derived" + }, + { + "description": "Objects that are mentioned in blocks of this object", + "format": "object", + "hidden": true, + "key": "mentions", + "maxCount": 0, + "name": "Mentions", + "readonly": true, + "source": "local" } ] diff --git a/pkg/lib/bundle/systemRelations.gen.go b/pkg/lib/bundle/systemRelations.gen.go index a1afbe32f6..71b7a213a0 100644 --- a/pkg/lib/bundle/systemRelations.gen.go +++ b/pkg/lib/bundle/systemRelations.gen.go @@ -6,7 +6,7 @@ package bundle import domain "github.com/anyproto/anytype-heart/core/domain" -const SystemRelationsChecksum = "52bf7e07b6d5309aab6d6adebd047658e6e9eb173b0f34d80849b5423eecb52b" +const SystemRelationsChecksum = "681765e1ebf081ea146276f4cfae48c88b9f5f7efa9118858a78dddd45d73564" // SystemRelations contains relations that have some special biz logic depends on them in some objects // in case EVERY object depend on the relation please add it to RequiredInternalRelations @@ -77,7 +77,9 @@ var SystemRelations = append(RequiredInternalRelations, []domain.RelationKey{ RelationKeyLatestAclHeadId, RelationKeyIdentity, RelationKeyGlobalName, - RelationKeyGlobalName, + RelationKeyScope, + RelationKeyLastUsedDate, + RelationKeyMentions, RelationKeyChatId, RelationKeyHasChat, }...) diff --git a/pkg/lib/bundle/systemRelations.json b/pkg/lib/bundle/systemRelations.json index 0c749b36e7..61f73c42bd 100644 --- a/pkg/lib/bundle/systemRelations.json +++ b/pkg/lib/bundle/systemRelations.json @@ -86,7 +86,9 @@ "syncDate", "syncStatus", "syncError", - "globalName", + "scope", + "lastUsedDate", + "mentions", "chatId", "hasChat" ] diff --git a/pkg/lib/bundle/types.gen.go b/pkg/lib/bundle/types.gen.go index 9615ea6587..b870630ebe 100644 --- a/pkg/lib/bundle/types.gen.go +++ b/pkg/lib/bundle/types.gen.go @@ -9,7 +9,7 @@ import ( "github.com/anyproto/anytype-heart/pkg/lib/pb/model" ) -const TypeChecksum = "4e2606150e8a20ccec464cf549ffe887b9f53c917cba29ad6732178dbb989659" +const TypeChecksum = "8e3a72b8e7042d88e36385296d59e27702b96ca6c9cce890ac4c7ce4fa1e0247" const ( TypePrefix = "_ot" ) @@ -18,15 +18,12 @@ const ( TypeKeyNote domain.TypeKey = "note" TypeKeyContact domain.TypeKey = "contact" TypeKeyBookmark domain.TypeKey = "bookmark" - TypeKeyWeeklyPlan domain.TypeKey = "weeklyPlan" TypeKeyDate domain.TypeKey = "date" - TypeKeyIdea domain.TypeKey = "idea" TypeKeyTask domain.TypeKey = "task" TypeKeyRelation domain.TypeKey = "relation" TypeKeyBook domain.TypeKey = "book" TypeKeyVideo domain.TypeKey = "video" TypeKeyDashboard domain.TypeKey = "dashboard" - TypeKeyDailyPlan domain.TypeKey = "dailyPlan" TypeKeyMovie domain.TypeKey = "movie" TypeKeyObjectType domain.TypeKey = "objectType" TypeKeyRelationOption domain.TypeKey = "relationOption" @@ -36,16 +33,12 @@ const ( TypeKeyTemplate domain.TypeKey = "template" TypeKeySet domain.TypeKey = "set" TypeKeyCollection domain.TypeKey = "collection" - TypeKeyClassNote domain.TypeKey = "classNote" TypeKeyDiaryEntry domain.TypeKey = "diaryEntry" TypeKeyPage domain.TypeKey = "page" TypeKeyImage domain.TypeKey = "image" - TypeKeyBug domain.TypeKey = "bug" TypeKeyProfile domain.TypeKey = "profile" TypeKeyAudio domain.TypeKey = "audio" TypeKeyGoal domain.TypeKey = "goal" - TypeKeyFeature domain.TypeKey = "feature" - TypeKeyDocument domain.TypeKey = "document" TypeKeyFile domain.TypeKey = "file" TypeKeyProject domain.TypeKey = "project" TypeKeyChat domain.TypeKey = "chat" @@ -61,7 +54,7 @@ var ( Layout: model.ObjectType_file, Name: "Audio", Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyArtist), MustGetRelationLink(RelationKeyAudioAlbum), MustGetRelationLink(RelationKeyAudioAlbumTrackNumber), MustGetRelationLink(RelationKeyAudioGenre), MustGetRelationLink(RelationKeyReleasedYear), MustGetRelationLink(RelationKeyThumbnailImage), MustGetRelationLink(RelationKeyComposer), MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyFileMimeType), MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyFileExt), MustGetRelationLink(RelationKeyAudioArtist), MustGetRelationLink(RelationKeyAudioLyrics)}, + RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyArtist), MustGetRelationLink(RelationKeyAudioAlbum), MustGetRelationLink(RelationKeyAudioAlbumTrackNumber), MustGetRelationLink(RelationKeyAudioGenre), MustGetRelationLink(RelationKeyAudioLyrics), MustGetRelationLink(RelationKeyReleasedYear), MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyFileMimeType), MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyFileExt), MustGetRelationLink(RelationKeyOrigin)}, RestrictObjectCreation: true, Types: []model.SmartBlockType{model.SmartBlockType_File}, Url: TypePrefix + "audio", @@ -73,7 +66,7 @@ var ( Layout: model.ObjectType_basic, Name: "Book", Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyAuthor), MustGetRelationLink(RelationKeyCategory), MustGetRelationLink(RelationKeyRating), MustGetRelationLink(RelationKeyStatus), MustGetRelationLink(RelationKeyStarred), MustGetRelationLink(RelationKeyUrl)}, + RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyAuthor), MustGetRelationLink(RelationKeyStatus), MustGetRelationLink(RelationKeyStarred), MustGetRelationLink(RelationKeyUrl)}, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "book", }, @@ -88,17 +81,6 @@ var ( Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "bookmark", }, - TypeKeyBug: { - - Description: "An error, fault or flaw in any computer program or a hardware system. A bug produces unexpected results or causes a system to behave unexpectedly", - IconEmoji: "🐞", - Layout: model.ObjectType_todo, - Name: "Bug (Software)", - Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyHowToReproduce), MustGetRelationLink(RelationKeyResult), MustGetRelationLink(RelationKeyAdditional), MustGetRelationLink(RelationKeyAttachments), MustGetRelationLink(RelationKeyAssignee), MustGetRelationLink(RelationKeyDueDate), MustGetRelationLink(RelationKeyPriority)}, - Types: []model.SmartBlockType{model.SmartBlockType_Page}, - Url: TypePrefix + "bug", - }, TypeKeyChat: { Description: "A chat", @@ -120,17 +102,6 @@ var ( Types: []model.SmartBlockType{model.SmartBlockType_ChatDerivedObject}, Url: TypePrefix + "chatDerived", }, - TypeKeyClassNote: { - - Description: "Note for recording lectures or seminars", - IconEmoji: "👨🏻\u200d🏫", - Layout: model.ObjectType_basic, - Name: "Class Note", - Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyClass), MustGetRelationLink(RelationKeyClassType), MustGetRelationLink(RelationKeyRecords), MustGetRelationLink(RelationKeyQuestions), MustGetRelationLink(RelationKeyMaterials), MustGetRelationLink(RelationKeyTasks), MustGetRelationLink(RelationKeyReflection)}, - Types: []model.SmartBlockType{model.SmartBlockType_Page}, - Url: TypePrefix + "classNote", - }, TypeKeyCollection: { Description: "Collect objects in one place, use different views to organize them", @@ -149,21 +120,10 @@ var ( Layout: model.ObjectType_profile, Name: "Contact", Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyPhone), MustGetRelationLink(RelationKeyEmail), MustGetRelationLink(RelationKeyDateOfBirth), MustGetRelationLink(RelationKeyPlaceOfBirth), MustGetRelationLink(RelationKeyCompany), MustGetRelationLink(RelationKeySocialProfile), MustGetRelationLink(RelationKeyJob), MustGetRelationLink(RelationKeyLinkedContacts), MustGetRelationLink(RelationKeyOccupation), MustGetRelationLink(RelationKeyInstagram), MustGetRelationLink(RelationKeyGender), MustGetRelationLink(RelationKeyFacebook)}, + RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyPhone), MustGetRelationLink(RelationKeyEmail), MustGetRelationLink(RelationKeyCompany)}, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "contact", }, - TypeKeyDailyPlan: { - - Description: "A detailed proposal for doing or achieving something for the day\n", - IconEmoji: "📆", - Layout: model.ObjectType_todo, - Name: "Daily Plan", - Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyTasks), MustGetRelationLink(RelationKeyEvents)}, - Types: []model.SmartBlockType{model.SmartBlockType_Page}, - Url: TypePrefix + "dailyPlan", - }, TypeKeyDashboard: { Description: "Internal home dashboard with favourite objects", @@ -198,28 +158,6 @@ var ( Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "diaryEntry", }, - TypeKeyDocument: { - - Description: "A piece of matter that provides information or evidence or that serves as an official record", - IconEmoji: "📃", - Layout: model.ObjectType_basic, - Name: "Document", - Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag)}, - Types: []model.SmartBlockType{model.SmartBlockType_Page}, - Url: TypePrefix + "document", - }, - TypeKeyFeature: { - - Description: "A distinguishing characteristic of a software item (e.g., performance, portability, or functionality)", - IconEmoji: "🪁", - Layout: model.ObjectType_todo, - Name: "Feature", - Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyHypothesisAssumptions), MustGetRelationLink(RelationKeyProblem), MustGetRelationLink(RelationKeyUserStories), MustGetRelationLink(RelationKeyLogic), MustGetRelationLink(RelationKeyMeasureOfSuccess), MustGetRelationLink(RelationKeyAttachments), MustGetRelationLink(RelationKeyAssignee), MustGetRelationLink(RelationKeyDueDate), MustGetRelationLink(RelationKeyPriority)}, - Types: []model.SmartBlockType{model.SmartBlockType_Page}, - Url: TypePrefix + "feature", - }, TypeKeyFile: { Description: "Computer resource for recording data in a computer storage device", @@ -227,7 +165,7 @@ var ( Layout: model.ObjectType_file, Name: "File", Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyFileMimeType), MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyFileExt)}, + RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyFileMimeType), MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyFileExt), MustGetRelationLink(RelationKeyOrigin)}, RestrictObjectCreation: true, Types: []model.SmartBlockType{model.SmartBlockType_File}, Url: TypePrefix + "file", @@ -243,17 +181,6 @@ var ( Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "goal", }, - TypeKeyIdea: { - - Description: "A thought or suggestion as to a possible course of action", - IconEmoji: "💡", - Layout: model.ObjectType_basic, - Name: "Idea", - Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyProblem), MustGetRelationLink(RelationKeySolution), MustGetRelationLink(RelationKeyAlternative)}, - Types: []model.SmartBlockType{model.SmartBlockType_Page}, - Url: TypePrefix + "idea", - }, TypeKeyImage: { Description: "A representation of the external form of a person or thing in art", @@ -261,7 +188,7 @@ var ( Layout: model.ObjectType_image, Name: "Image", Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyFileMimeType), MustGetRelationLink(RelationKeyWidthInPixels), MustGetRelationLink(RelationKeyCamera), MustGetRelationLink(RelationKeyHeightInPixels), MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyCameraIso), MustGetRelationLink(RelationKeyAperture), MustGetRelationLink(RelationKeyExposure), MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyFocalRatio), MustGetRelationLink(RelationKeyFileExt)}, + RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyFileMimeType), MustGetRelationLink(RelationKeyWidthInPixels), MustGetRelationLink(RelationKeyCamera), MustGetRelationLink(RelationKeyHeightInPixels), MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyCameraIso), MustGetRelationLink(RelationKeyAperture), MustGetRelationLink(RelationKeyExposure), MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyFocalRatio), MustGetRelationLink(RelationKeyFileExt), MustGetRelationLink(RelationKeyOrigin)}, RestrictObjectCreation: true, Types: []model.SmartBlockType{model.SmartBlockType_File}, Url: TypePrefix + "image", @@ -273,7 +200,7 @@ var ( Layout: model.ObjectType_basic, Name: "Movie", Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyDirector), MustGetRelationLink(RelationKeyStars), MustGetRelationLink(RelationKeyGenre), MustGetRelationLink(RelationKeyTrailer), MustGetRelationLink(RelationKeyRating), MustGetRelationLink(RelationKeyImdbRating), MustGetRelationLink(RelationKeyRottenTomatoesRating), MustGetRelationLink(RelationKeyStatus)}, + RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyGenre), MustGetRelationLink(RelationKeyStatus)}, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "movie", }, @@ -341,7 +268,7 @@ var ( Layout: model.ObjectType_basic, Name: "Project", Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyObjectives), MustGetRelationLink(RelationKeyScope), MustGetRelationLink(RelationKeyTimeframe), MustGetRelationLink(RelationKeyBudget), MustGetRelationLink(RelationKeyStakeholders), MustGetRelationLink(RelationKeyTasks)}, + RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyTasks)}, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "project", }, @@ -352,7 +279,7 @@ var ( Layout: model.ObjectType_basic, Name: "Recipe", Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyTime), MustGetRelationLink(RelationKeyServings), MustGetRelationLink(RelationKeyIngredients), MustGetRelationLink(RelationKeyInstructions), MustGetRelationLink(RelationKeyDifficulty)}, + RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyTime), MustGetRelationLink(RelationKeyIngredients)}, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "recipe", }, @@ -423,7 +350,7 @@ var ( Layout: model.ObjectType_todo, Name: "Task", Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyAssignee), MustGetRelationLink(RelationKeyDueDate), MustGetRelationLink(RelationKeyAttachments), MustGetRelationLink(RelationKeyStatus), MustGetRelationLink(RelationKeyDone), MustGetRelationLink(RelationKeyPriority), MustGetRelationLink(RelationKeyTasks), MustGetRelationLink(RelationKeyLinkedProjects)}, + RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyAssignee), MustGetRelationLink(RelationKeyDueDate), MustGetRelationLink(RelationKeyStatus), MustGetRelationLink(RelationKeyDone), MustGetRelationLink(RelationKeyPriority), MustGetRelationLink(RelationKeyTasks), MustGetRelationLink(RelationKeyLinkedProjects)}, Types: []model.SmartBlockType{model.SmartBlockType_Page}, Url: TypePrefix + "task", }, @@ -445,21 +372,10 @@ var ( Layout: model.ObjectType_file, Name: "Video", Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyFileMimeType), MustGetRelationLink(RelationKeyCamera), MustGetRelationLink(RelationKeyThumbnailImage), MustGetRelationLink(RelationKeyHeightInPixels), MustGetRelationLink(RelationKeyWidthInPixels), MustGetRelationLink(RelationKeyCameraIso), MustGetRelationLink(RelationKeyAperture), MustGetRelationLink(RelationKeyExposure), MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyFileExt)}, + RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeySizeInBytes), MustGetRelationLink(RelationKeyFileMimeType), MustGetRelationLink(RelationKeyCamera), MustGetRelationLink(RelationKeyHeightInPixels), MustGetRelationLink(RelationKeyWidthInPixels), MustGetRelationLink(RelationKeyCameraIso), MustGetRelationLink(RelationKeyAperture), MustGetRelationLink(RelationKeyExposure), MustGetRelationLink(RelationKeyAddedDate), MustGetRelationLink(RelationKeyFileExt), MustGetRelationLink(RelationKeyOrigin)}, RestrictObjectCreation: true, Types: []model.SmartBlockType{model.SmartBlockType_File}, Url: TypePrefix + "video", }, - TypeKeyWeeklyPlan: { - - Description: "The act of organizing your activities and tasks for the week", - IconEmoji: "🗓️", - Layout: model.ObjectType_todo, - Name: "Weekly Plan", - Readonly: true, - RelationLinks: []*model.RelationLink{MustGetRelationLink(RelationKeyTag), MustGetRelationLink(RelationKeyEvents), MustGetRelationLink(RelationKeyTasks)}, - Types: []model.SmartBlockType{model.SmartBlockType_Page}, - Url: TypePrefix + "weeklyPlan", - }, } ) diff --git a/pkg/lib/bundle/types.json b/pkg/lib/bundle/types.json index 9fcf04a4c2..54b355007c 100644 --- a/pkg/lib/bundle/types.json +++ b/pkg/lib/bundle/types.json @@ -11,10 +11,7 @@ "relations": [ "tag", "time", - "servings", - "ingredients", - "instructions", - "difficulty" + "ingredients" ], "description": "A recipe is a set of instructions that describes how to prepare or make something, especially a dish of prepared food" }, @@ -45,16 +42,7 @@ "tag", "phone", "email", - "dateOfBirth", - "placeOfBirth", - "company", - "socialProfile", - "job", - "linkedContacts", - "occupation", - "instagram", - "gender", - "facebook" + "company" ], "description": "Information to make action of communicating or meeting with Human or Company" }, @@ -74,22 +62,6 @@ ], "description": "URL that is stored as Object and may be categorised and linked with objects" }, - { - "id": "weeklyPlan", - "name": "Weekly Plan", - "types": [ - "Page" - ], - "emoji": "🗓️", - "hidden": false, - "layout": "todo", - "relations": [ - "tag", - "events", - "tasks" - ], - "description": "The act of organizing your activities and tasks for the week" - }, { "id": "date", "name": "Date", @@ -104,23 +76,6 @@ ], "description": "Gregorian calendar date" }, - { - "id": "idea", - "name": "Idea", - "types": [ - "Page" - ], - "emoji": "💡", - "hidden": false, - "layout": "basic", - "relations": [ - "tag", - "problem", - "solution", - "alternative" - ], - "description": "A thought or suggestion as to a possible course of action" - }, { "id": "task", "name": "Task", @@ -134,7 +89,6 @@ "tag", "assignee", "dueDate", - "attachments", "status", "done", "priority", @@ -173,8 +127,6 @@ "relations": [ "tag", "author", - "category", - "rating", "status", "starred", "url" @@ -194,14 +146,14 @@ "sizeInBytes", "fileMimeType", "camera", - "thumbnailImage", "heightInPixels", "widthInPixels", "cameraIso", "aperture", "exposure", "addedDate", - "fileExt" + "fileExt", + "origin" ], "description": "The recording of moving visual images", "restrictObjectCreation": true @@ -219,22 +171,6 @@ "description": "Internal home dashboard with favourite objects", "restrictObjectCreation": true }, - { - "id": "dailyPlan", - "name": "Daily Plan", - "types": [ - "Page" - ], - "emoji": "📆", - "hidden": false, - "layout": "todo", - "relations": [ - "tag", - "tasks", - "events" - ], - "description": "A detailed proposal for doing or achieving something for the day\n" - }, { "id": "movie", "name": "Movie", @@ -246,13 +182,7 @@ "layout": "basic", "relations": [ "tag", - "director", - "stars", "genre", - "trailer", - "rating", - "imdbRating", - "rottenTomatoesRating", "status" ], "description": "Motion picture or Moving picture, is a work of visual art used to simulate experiences that communicate ideas, stories, perceptions, feelings, beauty, or atmosphere through the use of moving images" @@ -375,27 +305,6 @@ ], "description": "Collect objects in one place, use different views to organize them" }, - { - "id": "classNote", - "name": "Class Note", - "types": [ - "Page" - ], - "emoji": "👨🏻‍🏫", - "hidden": false, - "layout": "basic", - "relations": [ - "tag", - "class", - "classType", - "records", - "questions", - "materials", - "tasks", - "reflection" - ], - "description": "Note for recording lectures or seminars" - }, { "id": "diaryEntry", "name": "Diary Entry", @@ -445,32 +354,12 @@ "exposure", "addedDate", "focalRatio", - "fileExt" + "fileExt", + "origin" ], "description": "A representation of the external form of a person or thing in art", "restrictObjectCreation": true }, - { - "id": "bug", - "name": "Bug (Software)", - "types": [ - "Page" - ], - "emoji": "🐞", - "hidden": false, - "layout": "todo", - "relations": [ - "tag", - "howToReproduce", - "result", - "additional", - "attachments", - "assignee", - "dueDate", - "priority" - ], - "description": "An error, fault or flaw in any computer program or a hardware system. A bug produces unexpected results or causes a system to behave unexpectedly" - }, { "id": "profile", "name": "Human", @@ -500,15 +389,13 @@ "audioAlbum", "audioAlbumTrackNumber", "audioGenre", + "audioLyrics", "releasedYear", - "thumbnailImage", - "composer", "sizeInBytes", "fileMimeType", "addedDate", "fileExt", - "audioArtist", - "audioLyrics" + "origin" ], "description": "Sound when recorded, with ability to reproduce", "restrictObjectCreation": true @@ -531,43 +418,6 @@ ], "description": "The object of a person's ambition or effort; an aim or desired result" }, - { - "id": "feature", - "name": "Feature", - "types": [ - "Page" - ], - "emoji": "🪁", - "hidden": false, - "layout": "todo", - "relations": [ - "tag", - "hypothesisAssumptions", - "problem", - "userStories", - "logic", - "measureOfSuccess", - "attachments", - "assignee", - "dueDate", - "priority" - ], - "description": "A distinguishing characteristic of a software item (e.g., performance, portability, or functionality)" - }, - { - "id": "document", - "name": "Document", - "types": [ - "Page" - ], - "emoji": "📃", - "hidden": false, - "layout": "basic", - "relations": [ - "tag" - ], - "description": "A piece of matter that provides information or evidence or that serves as an official record" - }, { "id": "file", "name": "File", @@ -581,7 +431,8 @@ "fileMimeType", "sizeInBytes", "addedDate", - "fileExt" + "fileExt", + "origin" ], "description": "Computer resource for recording data in a computer storage device", "restrictObjectCreation": true @@ -597,11 +448,6 @@ "layout": "basic", "relations": [ "tag", - "objectives", - "scope", - "timeframe", - "budget", - "stakeholders", "tasks" ], "description": "An individual or collaborative enterprise that is carefully planned to achieve a particular aim" diff --git a/pkg/lib/database/database.go b/pkg/lib/database/database.go index 19a9e9dc8e..dc7ac32906 100644 --- a/pkg/lib/database/database.go +++ b/pkg/lib/database/database.go @@ -3,6 +3,7 @@ package database import ( "github.com/gogo/protobuf/types" "github.com/valyala/fastjson" + "golang.org/x/text/collate" "github.com/anyproto/anytype-heart/core/domain" "github.com/anyproto/anytype-heart/core/relationutils" @@ -124,7 +125,7 @@ func injectDefaultOrder(qry Query, sorts []*model.BlockContentDataviewSort) []*m return sorts } -func NewFilters(qry Query, store ObjectStore, arena *fastjson.Arena) (filters *Filters, err error) { +func NewFilters(qry Query, store ObjectStore, arena *fastjson.Arena, collatorBuffer *collate.Buffer) (filters *Filters, err error) { // spaceID could be empty spaceID := getSpaceIDFromFilters(qry.Filters) qry.Filters = injectDefaultFilters(qry.Filters) @@ -132,9 +133,10 @@ func NewFilters(qry Query, store ObjectStore, arena *fastjson.Arena) (filters *F filters = new(Filters) qb := queryBuilder{ - spaceId: spaceID, - arena: arena, - objectStore: store, + spaceId: spaceID, + arena: arena, + objectStore: store, + collatorBuffer: collatorBuffer, } filterObj, err := MakeFilters(qry.Filters, store) @@ -148,9 +150,10 @@ func NewFilters(qry Query, store ObjectStore, arena *fastjson.Arena) (filters *F } type queryBuilder struct { - spaceId string - arena *fastjson.Arena - objectStore ObjectStore + spaceId string + arena *fastjson.Arena + objectStore ObjectStore + collatorBuffer *collate.Buffer } func getSpaceIDFromFilters(filters []*model.BlockContentDataviewFilter) string { @@ -180,6 +183,7 @@ func (b *queryBuilder) extractOrder(sorts []*model.BlockContentDataviewSort) Set relationFormat: format, Store: b.objectStore, arena: b.arena, + collatorBuffer: b.collatorBuffer, } order = b.appendCustomOrder(sort, order, keyOrder) } diff --git a/pkg/lib/database/database_test.go b/pkg/lib/database/database_test.go index a0f9bc15f6..284b986b5e 100644 --- a/pkg/lib/database/database_test.go +++ b/pkg/lib/database/database_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/valyala/fastjson" + "golang.org/x/text/collate" "github.com/anyproto/anytype-heart/core/domain" "github.com/anyproto/anytype-heart/pkg/lib/bundle" @@ -144,7 +145,7 @@ func Test_NewFilters(t *testing.T) { mockStore := NewMockObjectStore(t) // when - filters, err := NewFilters(Query{}, mockStore, &fastjson.Arena{}) + filters, err := NewFilters(Query{}, mockStore, &fastjson.Arena{}, &collate.Buffer{}) // then assert.Nil(t, err) @@ -176,7 +177,7 @@ func Test_NewFilters(t *testing.T) { } // when - filters, err := NewFilters(Query{Filters: filter}, mockStore, &fastjson.Arena{}) + filters, err := NewFilters(Query{Filters: filter}, mockStore, &fastjson.Arena{}, &collate.Buffer{}) // when assert.Nil(t, err) @@ -216,7 +217,7 @@ func Test_NewFilters(t *testing.T) { } // then - filters, err := NewFilters(Query{Filters: filter}, mockStore, &fastjson.Arena{}) + filters, err := NewFilters(Query{Filters: filter}, mockStore, &fastjson.Arena{}, &collate.Buffer{}) // when assert.Nil(t, err) @@ -256,7 +257,7 @@ func Test_NewFilters(t *testing.T) { } // then - filters, err := NewFilters(Query{Filters: filter}, mockStore, &fastjson.Arena{}) + filters, err := NewFilters(Query{Filters: filter}, mockStore, &fastjson.Arena{}, &collate.Buffer{}) // when assert.Nil(t, err) @@ -296,7 +297,7 @@ func Test_NewFilters(t *testing.T) { } // then - filters, err := NewFilters(Query{Filters: filter}, mockStore, &fastjson.Arena{}) + filters, err := NewFilters(Query{Filters: filter}, mockStore, &fastjson.Arena{}, &collate.Buffer{}) // when assert.Nil(t, err) @@ -330,7 +331,7 @@ func Test_NewFilters(t *testing.T) { } // then - filters, err := NewFilters(Query{Filters: filter}, mockStore, &fastjson.Arena{}) + filters, err := NewFilters(Query{Filters: filter}, mockStore, &fastjson.Arena{}, &collate.Buffer{}) // when assert.Nil(t, err) diff --git a/pkg/lib/localstore/objectstore/fixture.go b/pkg/lib/localstore/objectstore/fixture.go index 9e6d52d9b5..0699b7c9fc 100644 --- a/pkg/lib/localstore/objectstore/fixture.go +++ b/pkg/lib/localstore/objectstore/fixture.go @@ -62,6 +62,7 @@ func NewStoreFixture(t testing.TB) *StoreFixture { arenaPool: &fastjson.ArenaPool{}, repoPath: walletService.RepoPath(), oldStore: oldStore, + collatorBufferPool: newCollatorBufferPool(), } t.Cleanup(func() { diff --git a/pkg/lib/localstore/objectstore/objects.go b/pkg/lib/localstore/objectstore/objects.go index d7e957efc2..bb800c3065 100644 --- a/pkg/lib/localstore/objectstore/objects.go +++ b/pkg/lib/localstore/objectstore/objects.go @@ -144,7 +144,8 @@ type dsObjectStore struct { virtualSpaces anystore.Collection pendingDetails anystore.Collection - arenaPool *fastjson.ArenaPool + arenaPool *fastjson.ArenaPool + collatorBufferPool *collatorBufferPool fts ftsearch.FTSearch @@ -181,6 +182,7 @@ func (s *dsObjectStore) Init(a *app.App) (err error) { s.fts = fts.(ftsearch.FTSearch) } s.arenaPool = &fastjson.ArenaPool{} + s.collatorBufferPool = newCollatorBufferPool() s.repoPath = app.MustComponent[wallet.Wallet](a).RepoPath() s.oldStore = app.MustComponent[oldstore.Service](a) diff --git a/pkg/lib/localstore/objectstore/queries.go b/pkg/lib/localstore/objectstore/queries.go index 48f9b2ad7f..f9e93dbe3a 100644 --- a/pkg/lib/localstore/objectstore/queries.go +++ b/pkg/lib/localstore/objectstore/queries.go @@ -6,12 +6,14 @@ import ( "math" "sort" "strings" + "sync" "time" "github.com/blevesearch/bleve/v2/search" "github.com/gogo/protobuf/types" "github.com/samber/lo" "golang.org/x/exp/slices" + "golang.org/x/text/collate" "github.com/anyproto/anytype-heart/core/domain" "github.com/anyproto/anytype-heart/pkg/lib/bundle" @@ -263,8 +265,11 @@ func (s *dsObjectStore) performQuery(q database.Query) (records []database.Recor arena := s.arenaPool.Get() defer s.arenaPool.Put(arena) + collatorBuffer := s.collatorBufferPool.get() + defer s.collatorBufferPool.put(collatorBuffer) + q.FullText = strings.TrimSpace(q.FullText) - filters, err := database.NewFilters(q, s, arena) + filters, err := database.NewFilters(q, s, arena, collatorBuffer) if err != nil { return nil, fmt.Errorf("new filters: %w", err) } @@ -506,3 +511,26 @@ func (s *dsObjectStore) QueryByIDAndSubscribeForChanges(ids []string, sub databa s.addSubscriptionIfNotExists(sub) return } + +type collatorBufferPool struct { + pool *sync.Pool +} + +func newCollatorBufferPool() *collatorBufferPool { + return &collatorBufferPool{ + pool: &sync.Pool{ + New: func() interface{} { + return &collate.Buffer{} + }, + }, + } +} + +func (p *collatorBufferPool) get() *collate.Buffer { + return p.pool.Get().(*collate.Buffer) +} + +func (p *collatorBufferPool) put(b *collate.Buffer) { + b.Reset() + p.pool.Put(b) +} diff --git a/pkg/lib/localstore/objectstore/queries_test.go b/pkg/lib/localstore/objectstore/queries_test.go index ece21cef12..5ea0e2bdf0 100644 --- a/pkg/lib/localstore/objectstore/queries_test.go +++ b/pkg/lib/localstore/objectstore/queries_test.go @@ -13,6 +13,7 @@ import ( "github.com/stretchr/testify/require" "github.com/valyala/fastjson" "golang.org/x/exp/slices" + "golang.org/x/text/collate" "github.com/anyproto/anytype-heart/core/domain" "github.com/anyproto/anytype-heart/pkg/lib/bundle" @@ -921,7 +922,7 @@ func TestQueryRaw(t *testing.T) { obj3 := makeObjectWithName("id3", "name3") s.AddObjects(t, []TestObject{obj1, obj2, obj3}) - flt, err := database.NewFilters(database.Query{}, s, arena) + flt, err := database.NewFilters(database.Query{}, s, arena, &collate.Buffer{}) require.NoError(t, err) recs, err := s.QueryRaw(flt, 0, 0) @@ -944,7 +945,7 @@ func TestQueryRaw(t *testing.T) { Value: pbtypes.String("foo"), }, }, - }, s, arena) + }, s, arena, &collate.Buffer{}) require.NoError(t, err) recs, err := s.QueryRaw(flt, 0, 0) @@ -975,7 +976,7 @@ func TestQueryRaw(t *testing.T) { Value: pbtypes.String("ot-note"), }, }, - }, s, arena) + }, s, arena, &collate.Buffer{}) require.NoError(t, err) recs, err := s.QueryRaw(flt, 0, 0) @@ -1022,7 +1023,7 @@ func TestQueryRaw(t *testing.T) { Value: pbtypes.Int64(int64(model.ObjectType_basic)), }, }, - }, s, arena) + }, s, arena, &collate.Buffer{}) require.NoError(t, err) recs, err := s.QueryRaw(flt, 0, 0) diff --git a/pkg/lib/pb/model/localstore.pb.go b/pkg/lib/pb/model/localstore.pb.go index 67e3ba2069..3a284025f0 100644 --- a/pkg/lib/pb/model/localstore.pb.go +++ b/pkg/lib/pb/model/localstore.pb.go @@ -450,6 +450,7 @@ type ObjectStoreChecksums struct { AreOldFilesRemoved bool `protobuf:"varint,12,opt,name=areOldFilesRemoved,proto3" json:"areOldFilesRemoved,omitempty"` AreDeletedObjectsReindexed bool `protobuf:"varint,13,opt,name=areDeletedObjectsReindexed,proto3" json:"areDeletedObjectsReindexed,omitempty"` LinksErase int32 `protobuf:"varint,14,opt,name=linksErase,proto3" json:"linksErase,omitempty"` + MarketplaceForceReindexCounter int32 `protobuf:"varint,15,opt,name=marketplaceForceReindexCounter,proto3" json:"marketplaceForceReindexCounter,omitempty"` } func (m *ObjectStoreChecksums) Reset() { *m = ObjectStoreChecksums{} } @@ -583,6 +584,13 @@ func (m *ObjectStoreChecksums) GetLinksErase() int32 { return 0 } +func (m *ObjectStoreChecksums) GetMarketplaceForceReindexCounter() int32 { + if m != nil { + return m.MarketplaceForceReindexCounter + } + return 0 +} + func init() { proto.RegisterType((*ObjectInfo)(nil), "anytype.model.ObjectInfo") proto.RegisterType((*ObjectDetails)(nil), "anytype.model.ObjectDetails") @@ -599,52 +607,53 @@ func init() { } var fileDescriptor_9c35df71910469a5 = []byte{ - // 718 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xc1, 0x6e, 0xd3, 0x4a, - 0x14, 0xad, 0x93, 0xa6, 0x69, 0x6e, 0x5e, 0xda, 0xbe, 0x79, 0x4f, 0x62, 0x28, 0xc8, 0xb2, 0xa2, - 0x0a, 0x45, 0x15, 0x24, 0xa2, 0xa5, 0x1b, 0x16, 0x20, 0xb5, 0xa5, 0x52, 0xa1, 0x52, 0x24, 0xb7, - 0x08, 0x89, 0x9d, 0x1d, 0xdf, 0xb4, 0x43, 0x27, 0x1e, 0xcb, 0x33, 0x46, 0xcd, 0x82, 0x25, 0x1b, - 0x56, 0xfc, 0x00, 0x7f, 0xc3, 0x82, 0x65, 0x97, 0x2c, 0x51, 0xfb, 0x07, 0x7c, 0x01, 0xf2, 0x8c, - 0x93, 0x3a, 0x6e, 0x9a, 0x22, 0xc1, 0x32, 0xe7, 0x9e, 0x7b, 0x7c, 0xe6, 0xdc, 0x99, 0x1b, 0x68, - 0x45, 0xa7, 0xc7, 0x1d, 0xce, 0xfc, 0x4e, 0xe4, 0x77, 0x06, 0x22, 0x40, 0xde, 0x89, 0x62, 0xa1, - 0x84, 0xec, 0x70, 0xd1, 0xf3, 0xb8, 0x54, 0x22, 0xc6, 0xb6, 0x46, 0x48, 0xc3, 0x0b, 0x87, 0x6a, - 0x18, 0x61, 0x5b, 0xd3, 0x56, 0xef, 0x1f, 0x0b, 0x71, 0xcc, 0xd1, 0xd0, 0xfd, 0xa4, 0xdf, 0x91, - 0x2a, 0x4e, 0x7a, 0xca, 0x90, 0x57, 0xd7, 0x6e, 0x92, 0xd5, 0x3f, 0xa4, 0x61, 0x35, 0x7f, 0x5a, - 0x00, 0x5d, 0xff, 0x1d, 0xf6, 0xd4, 0x7e, 0xd8, 0x17, 0x64, 0x09, 0x4a, 0x2c, 0xa0, 0x96, 0x63, - 0xb5, 0x6a, 0x6e, 0x89, 0x05, 0xe4, 0x01, 0x2c, 0x09, 0x5d, 0x3d, 0x1a, 0x46, 0xf8, 0x3a, 0xe6, - 0x92, 0x96, 0x9c, 0x72, 0xab, 0xe6, 0x16, 0x50, 0xf2, 0x18, 0xaa, 0x01, 0x2a, 0x8f, 0x71, 0x49, - 0xcb, 0x8e, 0xd5, 0xaa, 0x6f, 0xdc, 0x69, 0x1b, 0x73, 0xed, 0x91, 0xb9, 0xf6, 0xa1, 0x36, 0xe7, - 0x8e, 0x78, 0x64, 0x0b, 0x6a, 0x31, 0x72, 0x4f, 0x31, 0x11, 0x4a, 0x3a, 0xef, 0x94, 0x75, 0xd3, - 0xc4, 0x01, 0xdb, 0x6e, 0x56, 0x77, 0xaf, 0x98, 0x84, 0x42, 0x55, 0x86, 0x2c, 0x8a, 0x50, 0xd1, - 0x8a, 0xb6, 0x39, 0xfa, 0x49, 0x5a, 0xb0, 0x7c, 0xe2, 0xc9, 0xfd, 0xd0, 0x17, 0x49, 0x18, 0x1c, - 0xb0, 0xf0, 0x54, 0xd2, 0x05, 0xc7, 0x6a, 0x2d, 0xba, 0x45, 0xb8, 0xb9, 0x0d, 0x0d, 0x73, 0xe6, - 0xdd, 0xcc, 0x4b, 0xce, 0xbe, 0xf5, 0x7b, 0xf6, 0x9b, 0x5d, 0xa8, 0x1b, 0x0d, 0x2d, 0x49, 0x6c, - 0x00, 0x66, 0x3e, 0xb1, 0xbf, 0x9b, 0x8a, 0xa4, 0x21, 0xe5, 0x10, 0xe2, 0x40, 0x5d, 0x24, 0x6a, - 0x4c, 0x30, 0x29, 0xe6, 0xa1, 0xe6, 0x07, 0x58, 0xce, 0x09, 0xea, 0x69, 0x6c, 0x42, 0x35, 0x93, - 0xd0, 0x8a, 0xf5, 0x8d, 0xbb, 0x85, 0x80, 0xae, 0x26, 0xe7, 0x8e, 0x98, 0x64, 0x0b, 0x16, 0x47, - 0xb2, 0xfa, 0x33, 0x33, 0xbb, 0xc6, 0xd4, 0xe6, 0x27, 0x0b, 0xfe, 0xbb, 0x2a, 0xbc, 0x61, 0xea, - 0xc4, 0x1c, 0xac, 0x78, 0x23, 0x1e, 0xc1, 0x3c, 0x0b, 0xfb, 0x82, 0x96, 0x74, 0x4e, 0x33, 0xa4, - 0x35, 0x8d, 0x3c, 0x81, 0x0a, 0xd7, 0xa3, 0x30, 0xd7, 0xc2, 0x9e, 0xca, 0x1f, 0x9f, 0xd8, 0x35, - 0xe4, 0xe6, 0x17, 0x0b, 0xee, 0x4d, 0x9a, 0xe9, 0x66, 0x3e, 0xff, 0x8a, 0xa9, 0xe7, 0xd0, 0x10, - 0x79, 0x3d, 0x5a, 0xbe, 0x2d, 0xa7, 0x49, 0x7e, 0xf3, 0xa3, 0x05, 0xf6, 0x0c, 0x7f, 0xe9, 0xc0, - 0xff, 0xd0, 0xe2, 0xda, 0x34, 0x8b, 0xb5, 0xa2, 0x8f, 0xaf, 0x15, 0xf8, 0xdf, 0xb4, 0x1e, 0xa6, - 0x6b, 0x62, 0xe7, 0x04, 0x7b, 0xa7, 0x32, 0x19, 0x48, 0xd2, 0x06, 0xe2, 0x27, 0x61, 0xc0, 0x31, - 0xe8, 0x8e, 0x1f, 0xaa, 0xcc, 0xdc, 0x4c, 0xa9, 0x90, 0x75, 0x58, 0xc9, 0x50, 0x77, 0xfc, 0x26, - 0x4b, 0x9a, 0x7d, 0x0d, 0x4f, 0x77, 0x42, 0x86, 0x1d, 0x78, 0x43, 0x91, 0x28, 0x33, 0xdb, 0x9a, - 0x5b, 0x40, 0xc9, 0x33, 0x58, 0x35, 0x5b, 0x42, 0xee, 0x89, 0xb8, 0x87, 0x2e, 0xb2, 0x30, 0xc0, - 0xb3, 0x1d, 0x91, 0x84, 0x0a, 0x63, 0x3a, 0xef, 0x58, 0xad, 0x8a, 0x3b, 0x83, 0x41, 0x9e, 0x02, - 0xed, 0x33, 0x8e, 0x53, 0xbb, 0x2b, 0xba, 0xfb, 0xc6, 0x3a, 0x79, 0x08, 0xff, 0xb2, 0xe0, 0xcc, - 0x45, 0x3f, 0x61, 0x3c, 0x18, 0x35, 0x2d, 0xe8, 0xa6, 0xeb, 0x85, 0x74, 0x73, 0xf4, 0x13, 0xce, - 0x15, 0x9e, 0xa9, 0xac, 0x42, 0xab, 0x9a, 0x5b, 0x84, 0xd3, 0xb1, 0x8c, 0xa0, 0x17, 0xb1, 0x27, - 0x91, 0xd6, 0x35, 0x6f, 0x12, 0xcc, 0xa5, 0x79, 0x84, 0x83, 0x88, 0x7b, 0x0a, 0x25, 0x5d, 0x9c, - 0x48, 0x73, 0x8c, 0xe7, 0xd2, 0x34, 0xf3, 0x90, 0xb4, 0xa6, 0x25, 0x0b, 0x28, 0x79, 0x09, 0x8e, - 0x3e, 0x6d, 0x3a, 0xe7, 0x57, 0x38, 0x9c, 0x9a, 0x0a, 0xe8, 0xce, 0x5b, 0x79, 0xe9, 0xed, 0xf0, - 0x62, 0xec, 0xf2, 0x60, 0x2f, 0x65, 0xba, 0x38, 0x10, 0xef, 0x31, 0xa0, 0xff, 0xe8, 0x65, 0x39, - 0xa5, 0x92, 0x4e, 0xd2, 0x8b, 0x71, 0x17, 0x39, 0xaa, 0xb1, 0xa1, 0x4c, 0x12, 0x03, 0xda, 0xd0, - 0x7d, 0x33, 0x18, 0xe9, 0x72, 0xd4, 0xef, 0xda, 0x44, 0xb6, 0xa4, 0x5d, 0xe6, 0x90, 0xed, 0xf5, - 0x6f, 0x17, 0xb6, 0x75, 0x7e, 0x61, 0x5b, 0x3f, 0x2e, 0x6c, 0xeb, 0xf3, 0xa5, 0x3d, 0x77, 0x7e, - 0x69, 0xcf, 0x7d, 0xbf, 0xb4, 0xe7, 0xde, 0xae, 0x14, 0xff, 0xc4, 0xfc, 0x05, 0xbd, 0x91, 0x37, - 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0xac, 0x43, 0xa0, 0xbb, 0x36, 0x07, 0x00, 0x00, + // 736 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xc1, 0x6e, 0xd3, 0x4c, + 0x10, 0xae, 0x93, 0x26, 0x69, 0x26, 0x7f, 0xda, 0xfe, 0xfb, 0xff, 0x12, 0x4b, 0x41, 0x96, 0x15, + 0x55, 0x28, 0xaa, 0x20, 0x11, 0x2d, 0xbd, 0x70, 0x00, 0xa9, 0x2d, 0x95, 0x0a, 0x95, 0x22, 0xb9, + 0x45, 0x48, 0xdc, 0xec, 0x78, 0xd2, 0x9a, 0x6c, 0xbc, 0x96, 0x77, 0x8d, 0x9a, 0x03, 0x47, 0x2e, + 0x88, 0x03, 0x2f, 0xc0, 0xfb, 0x70, 0xec, 0x91, 0x23, 0x6a, 0xdf, 0x80, 0x27, 0x40, 0xde, 0x75, + 0x52, 0xc7, 0x75, 0x53, 0x24, 0x38, 0xfa, 0x9b, 0x6f, 0xbe, 0xfd, 0x66, 0x66, 0x77, 0x0c, 0xed, + 0x70, 0x78, 0xd2, 0x65, 0xbe, 0xdb, 0x0d, 0xdd, 0xee, 0x88, 0x7b, 0xc8, 0xba, 0x61, 0xc4, 0x25, + 0x17, 0x5d, 0xc6, 0xfb, 0x0e, 0x13, 0x92, 0x47, 0xd8, 0x51, 0x08, 0x69, 0x3a, 0xc1, 0x58, 0x8e, + 0x43, 0xec, 0x28, 0xda, 0xda, 0xfd, 0x13, 0xce, 0x4f, 0x18, 0x6a, 0xba, 0x1b, 0x0f, 0xba, 0x42, + 0x46, 0x71, 0x5f, 0x6a, 0xf2, 0xda, 0xfa, 0x4d, 0xb2, 0xea, 0x43, 0x68, 0x56, 0xeb, 0xa7, 0x01, + 0xd0, 0x73, 0xdf, 0x61, 0x5f, 0x1e, 0x04, 0x03, 0x4e, 0x96, 0xa1, 0xe4, 0x7b, 0xd4, 0xb0, 0x8c, + 0x76, 0xdd, 0x2e, 0xf9, 0x1e, 0x79, 0x00, 0xcb, 0x5c, 0x45, 0x8f, 0xc7, 0x21, 0xbe, 0x8e, 0x98, + 0xa0, 0x25, 0xab, 0xdc, 0xae, 0xdb, 0x39, 0x94, 0x3c, 0x86, 0x9a, 0x87, 0xd2, 0xf1, 0x99, 0xa0, + 0x65, 0xcb, 0x68, 0x37, 0x36, 0xef, 0x74, 0xb4, 0xb9, 0xce, 0xc4, 0x5c, 0xe7, 0x48, 0x99, 0xb3, + 0x27, 0x3c, 0xb2, 0x0d, 0xf5, 0x08, 0x99, 0x23, 0x7d, 0x1e, 0x08, 0xba, 0x68, 0x95, 0x55, 0xd2, + 0x4c, 0x81, 0x1d, 0x3b, 0x8d, 0xdb, 0x57, 0x4c, 0x42, 0xa1, 0x26, 0x02, 0x3f, 0x0c, 0x51, 0xd2, + 0x8a, 0xb2, 0x39, 0xf9, 0x24, 0x6d, 0x58, 0x39, 0x75, 0xc4, 0x41, 0xe0, 0xf2, 0x38, 0xf0, 0x0e, + 0xfd, 0x60, 0x28, 0x68, 0xd5, 0x32, 0xda, 0x4b, 0x76, 0x1e, 0x6e, 0xed, 0x40, 0x53, 0xd7, 0xbc, + 0x97, 0x7a, 0xc9, 0xd8, 0x37, 0x7e, 0xcf, 0x7e, 0xab, 0x07, 0x0d, 0xad, 0xa1, 0x24, 0x89, 0x09, + 0xe0, 0xeb, 0x23, 0x0e, 0xf6, 0x12, 0x91, 0xa4, 0x49, 0x19, 0x84, 0x58, 0xd0, 0xe0, 0xb1, 0x9c, + 0x12, 0x74, 0x17, 0xb3, 0x50, 0xeb, 0x03, 0xac, 0x64, 0x04, 0xd5, 0x34, 0xb6, 0xa0, 0x96, 0x4a, + 0x28, 0xc5, 0xc6, 0xe6, 0xdd, 0x5c, 0x83, 0xae, 0x26, 0x67, 0x4f, 0x98, 0x64, 0x1b, 0x96, 0x26, + 0xb2, 0xea, 0x98, 0xb9, 0x59, 0x53, 0x6a, 0xeb, 0x93, 0x01, 0xff, 0x5d, 0x05, 0xde, 0xf8, 0xf2, + 0x54, 0x17, 0x96, 0xbf, 0x11, 0x8f, 0x60, 0xd1, 0x0f, 0x06, 0x9c, 0x96, 0x54, 0x9f, 0xe6, 0x48, + 0x2b, 0x1a, 0x79, 0x02, 0x15, 0xa6, 0x46, 0xa1, 0xaf, 0x85, 0x59, 0xc8, 0x9f, 0x56, 0x6c, 0x6b, + 0x72, 0xeb, 0xab, 0x01, 0xf7, 0x66, 0xcd, 0xf4, 0x52, 0x9f, 0x7f, 0xc5, 0xd4, 0x73, 0x68, 0xf2, + 0xac, 0x1e, 0x2d, 0xdf, 0xd6, 0xa7, 0x59, 0x7e, 0xeb, 0xa3, 0x01, 0xe6, 0x1c, 0x7f, 0xc9, 0xc0, + 0xff, 0xd0, 0xe2, 0x7a, 0x91, 0xc5, 0x7a, 0xde, 0xc7, 0xe7, 0x2a, 0xfc, 0xaf, 0x53, 0x8f, 0x92, + 0x35, 0xb1, 0x7b, 0x8a, 0xfd, 0xa1, 0x88, 0x47, 0x82, 0x74, 0x80, 0xb8, 0x71, 0xe0, 0x31, 0xf4, + 0x7a, 0xd3, 0x87, 0x2a, 0x52, 0x37, 0x05, 0x11, 0xb2, 0x01, 0xab, 0x29, 0x6a, 0x4f, 0xdf, 0x64, + 0x49, 0xb1, 0xaf, 0xe1, 0xc9, 0x4e, 0x48, 0xb1, 0x43, 0x67, 0xcc, 0x63, 0xa9, 0x67, 0x5b, 0xb7, + 0x73, 0x28, 0x79, 0x06, 0x6b, 0x7a, 0x4b, 0x88, 0x7d, 0x1e, 0xf5, 0xd1, 0x46, 0x3f, 0xf0, 0xf0, + 0x6c, 0x97, 0xc7, 0x81, 0xc4, 0x88, 0x2e, 0x5a, 0x46, 0xbb, 0x62, 0xcf, 0x61, 0x90, 0xa7, 0x40, + 0x07, 0x3e, 0xc3, 0xc2, 0xec, 0x8a, 0xca, 0xbe, 0x31, 0x4e, 0x1e, 0xc2, 0xbf, 0xbe, 0x77, 0x66, + 0xa3, 0x1b, 0xfb, 0xcc, 0x9b, 0x24, 0x55, 0x55, 0xd2, 0xf5, 0x40, 0xb2, 0x39, 0x06, 0x31, 0x63, + 0x12, 0xcf, 0x64, 0x1a, 0xa1, 0x35, 0xc5, 0xcd, 0xc3, 0xc9, 0x58, 0x26, 0xd0, 0x8b, 0xc8, 0x11, + 0x48, 0x1b, 0x8a, 0x37, 0x0b, 0x66, 0xba, 0x79, 0x8c, 0xa3, 0x90, 0x39, 0x12, 0x05, 0x5d, 0x9a, + 0xe9, 0xe6, 0x14, 0xcf, 0x74, 0x53, 0xcf, 0x43, 0xd0, 0xba, 0x92, 0xcc, 0xa1, 0xe4, 0x25, 0x58, + 0xaa, 0xda, 0x64, 0xce, 0xaf, 0x70, 0x5c, 0xd8, 0x15, 0x50, 0x99, 0xb7, 0xf2, 0x92, 0xdb, 0xe1, + 0x44, 0xd8, 0x63, 0xde, 0x7e, 0xc2, 0xb4, 0x71, 0xc4, 0xdf, 0xa3, 0x47, 0xff, 0x51, 0xcb, 0xb2, + 0x20, 0x92, 0x4c, 0xd2, 0x89, 0x70, 0x0f, 0x19, 0xca, 0xa9, 0xa1, 0x54, 0x12, 0x3d, 0xda, 0x54, + 0x79, 0x73, 0x18, 0xc9, 0x72, 0x54, 0xef, 0x5a, 0xb7, 0x6c, 0x59, 0xb9, 0xcc, 0x20, 0x64, 0x1f, + 0xcc, 0x91, 0x13, 0x0d, 0x51, 0x86, 0xcc, 0xe9, 0x63, 0x51, 0x65, 0x2b, 0x2a, 0xe7, 0x16, 0xd6, + 0xce, 0xc6, 0xb7, 0x0b, 0xd3, 0x38, 0xbf, 0x30, 0x8d, 0x1f, 0x17, 0xa6, 0xf1, 0xe5, 0xd2, 0x5c, + 0x38, 0xbf, 0x34, 0x17, 0xbe, 0x5f, 0x9a, 0x0b, 0x6f, 0x57, 0xf3, 0x3f, 0x43, 0xb7, 0xaa, 0x36, + 0xfb, 0xd6, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x3c, 0x0b, 0x32, 0x7e, 0x07, 0x00, 0x00, } func (m *ObjectInfo) Marshal() (dAtA []byte, err error) { @@ -1037,6 +1046,11 @@ func (m *ObjectStoreChecksums) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.MarketplaceForceReindexCounter != 0 { + i = encodeVarintLocalstore(dAtA, i, uint64(m.MarketplaceForceReindexCounter)) + i-- + dAtA[i] = 0x78 + } if m.LinksErase != 0 { i = encodeVarintLocalstore(dAtA, i, uint64(m.LinksErase)) i-- @@ -1349,6 +1363,9 @@ func (m *ObjectStoreChecksums) Size() (n int) { if m.LinksErase != 0 { n += 1 + sovLocalstore(uint64(m.LinksErase)) } + if m.MarketplaceForceReindexCounter != 0 { + n += 1 + sovLocalstore(uint64(m.MarketplaceForceReindexCounter)) + } return n } @@ -2717,6 +2734,25 @@ func (m *ObjectStoreChecksums) Unmarshal(dAtA []byte) error { break } } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketplaceForceReindexCounter", wireType) + } + m.MarketplaceForceReindexCounter = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLocalstore + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MarketplaceForceReindexCounter |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipLocalstore(dAtA[iNdEx:]) diff --git a/pkg/lib/pb/model/protos/localstore.proto b/pkg/lib/pb/model/protos/localstore.proto index f8c20924c3..5960fa069d 100644 --- a/pkg/lib/pb/model/protos/localstore.proto +++ b/pkg/lib/pb/model/protos/localstore.proto @@ -62,4 +62,5 @@ message ObjectStoreChecksums { bool areOldFilesRemoved = 12; bool areDeletedObjectsReindexed = 13; int32 linksErase = 14; + int32 marketplaceForceReindexCounter = 15; } diff --git a/util/builtinobjects/data/empty.zip b/util/builtinobjects/data/empty.zip index 40cf3cd0bd..ff70704cc3 100644 Binary files a/util/builtinobjects/data/empty.zip and b/util/builtinobjects/data/empty.zip differ diff --git a/util/builtinobjects/data/get_started.zip b/util/builtinobjects/data/get_started.zip index 90841f3b37..91a32e38d1 100644 Binary files a/util/builtinobjects/data/get_started.zip and b/util/builtinobjects/data/get_started.zip differ diff --git a/util/builtinobjects/data/knowledge_base.zip b/util/builtinobjects/data/knowledge_base.zip index b6eb614856..215fe84ed1 100644 Binary files a/util/builtinobjects/data/knowledge_base.zip and b/util/builtinobjects/data/knowledge_base.zip differ diff --git a/util/builtinobjects/data/notes_diary.zip b/util/builtinobjects/data/notes_diary.zip index 44379cb083..8c483ab367 100644 Binary files a/util/builtinobjects/data/notes_diary.zip and b/util/builtinobjects/data/notes_diary.zip differ diff --git a/util/builtinobjects/data/personal_projects.zip b/util/builtinobjects/data/personal_projects.zip index 94f5d2f4be..8d3b50e929 100644 Binary files a/util/builtinobjects/data/personal_projects.zip and b/util/builtinobjects/data/personal_projects.zip differ diff --git a/util/builtinobjects/data/strategic_writing.zip b/util/builtinobjects/data/strategic_writing.zip index 4d78c34f77..b1695e71a3 100644 Binary files a/util/builtinobjects/data/strategic_writing.zip and b/util/builtinobjects/data/strategic_writing.zip differ diff --git a/util/builtintemplate/data/bundled_templates.zip b/util/builtintemplate/data/bundled_templates.zip index d345823861..77a049ee65 100644 Binary files a/util/builtintemplate/data/bundled_templates.zip and b/util/builtintemplate/data/bundled_templates.zip differ diff --git a/util/text/text.go b/util/text/text.go index 507ec63b87..bf06c29fbc 100644 --- a/util/text/text.go +++ b/util/text/text.go @@ -37,7 +37,14 @@ func Truncate(text string, length int) string { } func UTF16RuneCountString(str string) int { - return len(utf16.Encode([]rune(str))) + buf := make([]uint16, 0, 2) + var n int + for _, s := range str { + buf = utf16.AppendRune(buf, s) + n += len(buf) + buf = buf[:0] + } + return n } func UTF16RuneCount(bStr []byte) int {