diff --git a/Makefile b/Makefile index 4e242666..40da02ba 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,8 @@ pull: build: pull docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis cs3apis-build -build-proto + # restore ownership of the `docs` folder as docker runs as root + chown -R `ls -ld . | awk '{print $$3 ":" $$4}'` docs python: pull docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis cs3apis-build -build-python go: pull diff --git a/cs3/app/provider/v1beta1/provider_api.proto b/cs3/app/provider/v1beta1/provider_api.proto index 6eea2d4d..ff7a175f 100644 --- a/cs3/app/provider/v1beta1/provider_api.proto +++ b/cs3/app/provider/v1beta1/provider_api.proto @@ -53,7 +53,7 @@ import "cs3/types/v1beta1/types.proto"; // Any method MAY return UNKNOWN. // Any method MAY return UNAUTHENTICATED. service ProviderAPI { - // Returns the App provider URL + // Returns the App URL and all necessary info to open a resource in an online editor. // MUST return CODE_NOT_FOUND if the resource does not exist. rpc OpenInApp(OpenInAppRequest) returns (OpenInAppResponse); } diff --git a/cs3/app/registry/v1beta1/registry_api.proto b/cs3/app/registry/v1beta1/registry_api.proto index 6deabf1b..86032bb7 100644 --- a/cs3/app/registry/v1beta1/registry_api.proto +++ b/cs3/app/registry/v1beta1/registry_api.proto @@ -57,7 +57,7 @@ service RegistryAPI { rpc AddAppProvider(AddAppProviderRequest) returns (AddAppProviderResponse); // Returns a list of the available app providers known by this registry. rpc ListAppProviders(ListAppProvidersRequest) returns (ListAppProvidersResponse); - // Returns a list of the supported mime types along with the apps which they can opened with. + // Returns a list of the supported mime types along with the apps which they can be opened with. rpc ListSupportedMimeTypes(ListSupportedMimeTypesRequest) returns (ListSupportedMimeTypesResponse); // Returns the default app provider which serves a specified mime type. rpc GetDefaultAppProviderForMimeType(GetDefaultAppProviderForMimeTypeRequest) returns (GetDefaultAppProviderForMimeTypeResponse); @@ -136,8 +136,8 @@ message ListSupportedMimeTypesResponse { // Opaque information. cs3.types.v1beta1.Opaque opaque = 2; // REQUIRED. - // The list of supported mime types with the apps which they can be opened with. - map mime_types = 3; + // The list of supported mime types and their properties. + repeated MimeTypeInfo mime_types = 3; } message GetDefaultAppProviderForMimeTypeRequest { diff --git a/cs3/app/registry/v1beta1/resources.proto b/cs3/app/registry/v1beta1/resources.proto index b80d7b0a..9f9e2b5e 100644 --- a/cs3/app/registry/v1beta1/resources.proto +++ b/cs3/app/registry/v1beta1/resources.proto @@ -42,23 +42,53 @@ message ProviderInfo { // The address where the app provider can be reached. // For example, tcp://localhost:1099. string address = 3; + // REQUIRED. + // The capability of the underlying app. + enum Capability { + CAPABILITY_INVALID = 0; + // The app is a simple viewer. + CAPABILITY_VIEWER = 1; + // The app is a full editor. + CAPABILITY_EDITOR = 2; + } + Capability capability = 4; // OPTIONAL. - // A human-readable name of the app provider. - string name = 4; + // A human-readable name of the underlying app. + string name = 5; // OPTIONAL. // Information to describe the functionalities - // offered by the app provider. Meant to be read + // offered by the underlying app. Meant to be read // by humans. - string description = 5; + string description = 6; // OPTIONAL. // A URI to a static asset which represents the app icon. - string icon = 6; + string icon = 7; // OPTIONAL. // Whether the app can be opened only on desktop - bool desktop_only = 7; + bool desktop_only = 8; } -// Holds a list of app providers which can open a particular mime type. -message AppProviderList { - repeated ProviderInfo app_providers = 1; +// Represents a mime type and its corresponding file extension. +message MimeTypeInfo { + // OPTIONAL. + // Opaque information. + cs3.types.v1beta1.Opaque opaque = 1; + // REQUIRED. + // The mime type. + string mime_type = 2; + // REQUIRED. + // The file extension mapped to this mime type. + string ext = 3; + // REQUIRED. + // The list of app providers which can open this mime type + repeated ProviderInfo app_providers = 4; + // OPTIONAL. + // The friendly name of this mime type. + string name = 5; + // OPTIONAL. + // Human-readable information to describe the mime type. + string description = 6; + // OPTIONAL. + // A URI to a static asset which represents the mime type icon. + string icon = 7; } diff --git a/cs3/gateway/v1beta1/gateway_api.proto b/cs3/gateway/v1beta1/gateway_api.proto index bb0238aa..a572c483 100644 --- a/cs3/gateway/v1beta1/gateway_api.proto +++ b/cs3/gateway/v1beta1/gateway_api.proto @@ -179,7 +179,8 @@ service GatewayAPI { // ************************ APP PROVIDER ********************/ // *****************************************************************/ - // Returns the App provider URL, which allows the user to open a resource in an online editor. + // Returns the App URL and all necessary info to open a resource in an online editor. + // MUST return CODE_NOT_FOUND if the resource does not exist. rpc OpenInApp(OpenInAppRequest) returns (cs3.app.provider.v1beta1.OpenInAppResponse); // *****************************************************************/ // ************************ USER SHARE PROVIDER ********************/ diff --git a/docs/index.html b/docs/index.html index 9a9225d8..4eb3d4a8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -582,10 +582,6 @@

Table of Contents

MListSupportedMimeTypesResponse -
  • - MListSupportedMimeTypesResponse.MimeTypesEntry -
  • -
  • MSetDefaultAppProviderForMimeTypeRequest
  • @@ -610,7 +606,7 @@

    Table of Contents

    @@ -2779,7 +2779,8 @@

    GatewayAPI

    OpenInApp OpenInAppRequest .cs3.app.provider.v1beta1.OpenInAppResponse -

    Returns the App provider URL, which allows the user to open a resource in an online editor. +

    Returns the App URL and all necessary info to open a resource in an online editor. +MUST return CODE_NOT_FOUND if the resource does not exist. *****************************************************************/ ************************ USER SHARE PROVIDER ********************/ @@ -5145,7 +5146,7 @@

    ProviderAPI

    OpenInApp OpenInAppRequest OpenInAppResponse -

    Returns the App provider URL +

    Returns the App URL and all necessary info to open a resource in an online editor. MUST return CODE_NOT_FOUND if the resource does not exist.

    @@ -5621,41 +5622,10 @@

    ListSupportedMi mime_types - ListSupportedMimeTypesResponse.MimeTypesEntry + MimeTypeInfo repeated

    REQUIRED. -The list of supported mime types with the apps which they can be opened with.

    - - - - - - - - - -

    ListSupportedMimeTypesResponse.MimeTypesEntry

    -

    - - - - - - - - - - - - - - - - - - - - +The list of supported mime types and their properties.

    @@ -5779,7 +5749,7 @@

    RegistryAPI

    - + @@ -5808,8 +5778,8 @@

    cs3/app/registry/v1beta1/resou

    -

    AppProviderList

    -

    Holds a list of app providers which can open a particular mime type.

    +

    MimeTypeInfo

    +

    Represents a mime type and its corresponding file extension.

    FieldTypeLabelDescription
    keystring

    valueAppProviderList

    ListSupportedMimeTypes ListSupportedMimeTypesRequest ListSupportedMimeTypesResponse

    Returns a list of the supported mime types along with the apps which they can opened with.

    Returns a list of the supported mime types along with the apps which they can be opened with.

    @@ -5818,11 +5788,60 @@

    AppProviderList

    + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + @@ -5867,12 +5886,19 @@

    ProviderInfo

    For example, tcp://localhost:1099.

    + + + + + + + +A human-readable name of the underlying app.

    @@ -5881,7 +5907,7 @@

    ProviderInfo

    @@ -5910,6 +5936,35 @@

    ProviderInfo

    +

    ProviderInfo.Capability

    +

    REQUIRED.

    The capability of the underlying app.

    +
    opaquecs3.types.v1beta1.Opaque

    OPTIONAL. +Opaque information.

    mime_typestring

    REQUIRED. +The mime type.

    extstring

    REQUIRED. +The file extension mapped to this mime type.

    app_providers ProviderInfo repeated

    REQUIRED. +The list of app providers which can open this mime type

    namestring

    OPTIONAL. +The friendly name of this mime type.

    descriptionstring

    OPTIONAL. +Human-readable information to describe the mime type.

    iconstring

    OPTIONAL. +A URI to a static asset which represents the mime type icon.

    capabilityProviderInfo.Capability

    name string

    OPTIONAL. -A human-readable name of the app provider.

    OPTIONAL. Information to describe the functionalities -offered by the app provider. Meant to be read +offered by the underlying app. Meant to be read by humans.

    + + + + + + + + + + + + + + + + + + + + + + + + +
    NameNumberDescription
    CAPABILITY_INVALID0

    CAPABILITY_VIEWER1

    The app is a simple viewer.

    CAPABILITY_EDITOR2

    The app is a full editor.

    + diff --git a/proto.lock b/proto.lock index 9dffa863..fe23bc68 100644 --- a/proto.lock +++ b/proto.lock @@ -678,16 +678,12 @@ "id": 2, "name": "opaque", "type": "cs3.types.v1beta1.Opaque" - } - ], - "maps": [ + }, { - "key_type": "string", - "field": { - "id": 3, - "name": "mime_types", - "type": "AppProviderList" - } + "id": 3, + "name": "mime_types", + "type": "MimeTypeInfo", + "is_repeated": true } ] }, @@ -851,6 +847,24 @@ { "protopath": "cs3:/:app:/:registry:/:v1beta1:/:resources.proto", "def": { + "enums": [ + { + "name": "ProviderInfo.Capability", + "enum_fields": [ + { + "name": "CAPABILITY_INVALID" + }, + { + "name": "CAPABILITY_VIEWER", + "integer": 1 + }, + { + "name": "CAPABILITY_EDITOR", + "integer": 2 + } + ] + } + ], "messages": [ { "name": "ProviderInfo", @@ -873,34 +887,69 @@ }, { "id": 4, + "name": "capability", + "type": "Capability" + }, + { + "id": 5, "name": "name", "type": "string" }, { - "id": 5, + "id": 6, "name": "description", "type": "string" }, { - "id": 6, + "id": 7, "name": "icon", "type": "string" }, { - "id": 7, + "id": 8, "name": "desktop_only", "type": "bool" } ] }, { - "name": "AppProviderList", + "name": "MimeTypeInfo", "fields": [ { "id": 1, + "name": "opaque", + "type": "cs3.types.v1beta1.Opaque" + }, + { + "id": 2, + "name": "mime_type", + "type": "string" + }, + { + "id": 3, + "name": "ext", + "type": "string" + }, + { + "id": 4, "name": "app_providers", "type": "ProviderInfo", "is_repeated": true + }, + { + "id": 5, + "name": "name", + "type": "string" + }, + { + "id": 6, + "name": "description", + "type": "string" + }, + { + "id": 7, + "name": "icon", + "type": "string" } ] } @@ -5009,6 +5058,10 @@ { "name": "TYPE_GRANTEE_TYPE", "integer": 5 + }, + { + "name": "TYPE_EXCLUDE_DENIALS", + "integer": 6 } ] }