@d-najd/universal-media-tracker-sdk 0.1.11 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  export { default as Plugin } from './Plugin';
2
+ export { default as TriState } from './types/TriState';
2
3
  export { default as PluginSpec } from './types/PluginSpec';
3
4
  export { default as PluginConfig } from './types/PluginConfig';
4
5
  export { default as ResourceType } from './types/handler/media/ResourceType';
6
+ export { default as ResourceHandlerResponse } from './types/handler/media/ResourceHandlerResponse';
7
+ export { default as ResourceHandlerArgs } from './types/handler/media/ResourceHandlerArgs';
5
8
  export { default as ResourceHandler } from './types/handler/media/ResourceHandler';
6
- export { default as ResourceExtra } from './types/handler/media/ResourceExtra';
7
9
  export { default as CreateResourceHandler } from './types/handler/media/CreateResourceHandler';
8
10
  export { default as BaseResourceHandler } from './types/handler/media/BaseResourceHandler';
9
11
  export { default as HandlerTypes } from './types/handler/base/HandlerTypes';
@@ -12,13 +14,17 @@ export { default as CreateHandler } from './types/handler/base/CreateHandler';
12
14
  export { default as BaseHandlerResponse } from './types/handler/base/BaseHandlerResponse';
13
15
  export { default as BaseHandlerArgs } from './types/handler/base/BaseHandlerArgs';
14
16
  export { default as BaseHandler } from './types/handler/base/BaseHandler';
17
+ export { default as MetaPreview } from './types/handler/media/catalog/MetaPreview';
18
+ export { default as CreateCatalogHandler } from './types/handler/media/catalog/CreateCatalogHandler';
19
+ export { default as CatalogHandlerResponse } from './types/handler/media/catalog/CatalogHandlerResponse';
20
+ export { default as CatalogHandlerArgs } from './types/handler/media/catalog/CatalogHandlerArgs';
21
+ export { default as ResourceBrowseOptionDefaults } from './types/handler/media/browse-option/ResourceBrowseOptionDefaults';
22
+ export { default as ResourceBrowseOptionConverter } from './types/handler/media/browse-option/ResourceBrowseOptionConverter';
23
+ export { default as ResourceBrowseOptionArgs } from './types/handler/media/browse-option/ResourceBrowseOptionArgs';
24
+ export { default as ResourceBrowseOption } from './types/handler/media/browse-option/ResourceBrowseOption';
15
25
  export { default as PluginSourceHandlerResponse } from './types/handler/plugin/source/PluginSourceHandlerResponse';
16
26
  export { default as PluginSourceHandlerArgs } from './types/handler/plugin/source/PluginSourceHandlerArgs';
17
27
  export { default as CreatePluginSourceHandler } from './types/handler/plugin/source/CreatePluginSourceHandler';
18
28
  export { default as PluginFactoryHandlerResponse } from './types/handler/plugin/factory/PluginFactoryHandlerResponse';
19
29
  export { default as PluginFactoryHandlerArgs } from './types/handler/plugin/factory/PluginFactoryHandlerArgs';
20
30
  export { default as CreatePluginFactoryHandler } from './types/handler/plugin/factory/CreatePluginFactoryHandler';
21
- export { default as MetaPreview } from './types/handler/media/catalog/MetaPreview';
22
- export { default as CreateCatalogHandler } from './types/handler/media/catalog/CreateCatalogHandler';
23
- export { default as CatalogHandlerResponse } from './types/handler/media/catalog/CatalogHandlerResponse';
24
- export { default as CatalogHandlerArgs } from './types/handler/media/catalog/CatalogHandlerArgs';
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  // Auto‑generated barrel file – do not edit manually
2
2
  export { default as Plugin } from './Plugin';
3
+ export { default as ResourceBrowseOptionConverter } from './types/handler/media/browse-option/ResourceBrowseOptionConverter';
@@ -0,0 +1,2 @@
1
+ type TriState = 'include' | 'exclude' | 'unspecified';
2
+ export default TriState;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,11 +1,11 @@
1
- import BaseHandlerArgs from "../base/BaseHandlerArgs";
2
- import BaseHandlerResponse from "../base/BaseHandlerResponse";
3
1
  import ResourceType from "./ResourceType";
4
2
  import BaseHandler from "../base/BaseHandler";
5
- import ResourceExtra from "./ResourceExtra";
6
- type BaseResourceHandler<T extends BaseHandlerArgs = BaseHandlerArgs, R extends BaseHandlerResponse = BaseHandlerResponse> = BaseHandler<T, R> & {
3
+ import ResourceBrowseOption from "./browse-option/ResourceBrowseOption";
4
+ import ResourceHandlerArgs from "./ResourceHandlerArgs";
5
+ import ResourceHandlerResponse from "./ResourceHandlerResponse";
6
+ type BaseResourceHandler<T extends ResourceHandlerArgs = ResourceHandlerArgs, R extends ResourceHandlerResponse = ResourceHandlerResponse> = BaseHandler<T, R> & {
7
7
  readonly name?: string;
8
8
  readonly resourceType?: ResourceType | string;
9
- readonly extra?: ResourceExtra[];
9
+ readonly browseOptions?: ResourceBrowseOption[];
10
10
  };
11
11
  export default BaseResourceHandler;
@@ -1,9 +1,9 @@
1
- import BaseHandlerArgs from "../base/BaseHandlerArgs";
2
- import BaseHandlerResponse from "../base/BaseHandlerResponse";
3
1
  import BaseResourceHandler from "./BaseResourceHandler";
4
2
  import ResourceType from "./ResourceType";
5
3
  import HandlerTypes from "../base/HandlerTypes";
6
- type CreateResourceHandler<T extends BaseHandlerArgs = BaseHandlerArgs, R extends BaseHandlerResponse = BaseHandlerResponse> = BaseResourceHandler<T, R> & {
4
+ import ResourceHandlerArgs from "./ResourceHandlerArgs";
5
+ import ResourceHandlerResponse from "./ResourceHandlerResponse";
6
+ type CreateResourceHandler<T extends ResourceHandlerArgs = ResourceHandlerArgs, R extends ResourceHandlerResponse = ResourceHandlerResponse> = BaseResourceHandler<T, R> & {
7
7
  readonly type: HandlerTypes | string;
8
8
  readonly resourceType: ResourceType | string;
9
9
  };
@@ -1,10 +1,10 @@
1
- import BaseHandlerArgs from "../base/BaseHandlerArgs";
2
- import BaseHandlerResponse from "../base/BaseHandlerResponse";
3
1
  import ResourceType from "./ResourceType";
4
2
  import BaseResourceHandler from "./BaseResourceHandler";
5
3
  import Handler from "../base/Handler";
6
4
  import HandlerTypes from "../base/HandlerTypes";
7
- type ResourceHandler<T extends BaseHandlerArgs = BaseHandlerArgs, R extends BaseHandlerResponse = BaseHandlerResponse> = BaseResourceHandler<T, R> & Handler<T, R> & {
5
+ import ResourceHandlerArgs from "./ResourceHandlerArgs";
6
+ import ResourceHandlerResponse from "./ResourceHandlerResponse";
7
+ type ResourceHandler<T extends ResourceHandlerArgs = ResourceHandlerArgs, R extends ResourceHandlerResponse = ResourceHandlerResponse> = BaseResourceHandler<T, R> & Handler<T, R> & {
8
8
  /**
9
9
  * Displayed in the app
10
10
  */
@@ -0,0 +1,6 @@
1
+ import BaseHandlerArgs from "../base/BaseHandlerArgs";
2
+ import { ResourceBrowseOptionArgs } from "../../../index";
3
+ type ResourceHandlerArgs = BaseHandlerArgs & {
4
+ readonly browseOptions?: ResourceBrowseOptionArgs[];
5
+ };
6
+ export default ResourceHandlerArgs;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import BaseHandlerResponse from "../base/BaseHandlerResponse";
2
+ type ResourceHandlerResponse<T = any> = BaseHandlerResponse<T> & {};
3
+ export default ResourceHandlerResponse;
@@ -0,0 +1,29 @@
1
+ import ResourceBrowseOptionDefaults from "./ResourceBrowseOptionDefaults";
2
+ /**
3
+ * @see ResourceBrowseOptionDefaults
4
+ * @see ResourceBrowseOptionArgs
5
+ */
6
+ type ResourceBrowseOption = {
7
+ readonly name: ResourceBrowseOptionDefaults | string;
8
+ /**
9
+ * Maps to values in `ResourceExtraArgs`
10
+ * `string` to `string`
11
+ * `number` to `number`
12
+ * `radio` to `string` uses `options`
13
+ * `checkbox` to `string[]` uses `options`
14
+ * `direction` to `asc | desc` optional `options`
15
+ * `radioTriState` to `TriState` uses `options`
16
+ * `checkboxTriState` to `TriState[]` uses `options`
17
+ * @see ResourceBrowseOption
18
+ */
19
+ readonly type: 'string' | 'number' | 'radio' | 'checkbox' | 'direction' | 'radioTriState' | 'checkboxTriState';
20
+ /**
21
+ * Used if there are multiple options, to define which they are, like [action, adventure, drama]
22
+ */
23
+ readonly options?: string[];
24
+ /**
25
+ * @default false
26
+ */
27
+ readonly isRequired?: boolean;
28
+ };
29
+ export default ResourceBrowseOption;
@@ -0,0 +1,9 @@
1
+ import TriState from "../../../TriState";
2
+ type ResourceBrowseOptionArgs = {
3
+ readonly name: string;
4
+ /**
5
+ * @see ResourceExtra
6
+ */
7
+ readonly input: string | number | string[] | ('asc' | 'desc') | TriState | TriState[];
8
+ };
9
+ export default ResourceBrowseOptionArgs;
@@ -0,0 +1,5 @@
1
+ declare const browseOptionConverter: {
2
+ toArg: () => void;
3
+ toType: () => void;
4
+ };
5
+ export default browseOptionConverter;
@@ -0,0 +1,7 @@
1
+ const browseOptionConverter = {
2
+ toArg: () => {
3
+ },
4
+ toType: () => {
5
+ }
6
+ };
7
+ export default browseOptionConverter;
@@ -0,0 +1,4 @@
1
+ type ResourceBrowseOptionDefaults = 'search' | // type string
2
+ 'skip' | // type number (int), `isRequired` always false
3
+ 'genre';
4
+ export default ResourceBrowseOptionDefaults;
@@ -1,3 +1,3 @@
1
- import BaseHandlerArgs from "../../base/BaseHandlerArgs";
2
- type CatalogHandlerArgs = BaseHandlerArgs & {};
1
+ import ResourceHandlerArgs from "../ResourceHandlerArgs";
2
+ type CatalogHandlerArgs = ResourceHandlerArgs & {};
3
3
  export default CatalogHandlerArgs;
@@ -1,4 +1,4 @@
1
- import BaseHandlerResponse from "../../base/BaseHandlerResponse";
2
1
  import MetaPreview from "./MetaPreview";
3
- type CatalogHandlerResponse = BaseHandlerResponse<MetaPreview> & {};
2
+ import ResourceHandlerResponse from "../ResourceHandlerResponse";
3
+ type CatalogHandlerResponse = ResourceHandlerResponse<MetaPreview> & {};
4
4
  export default CatalogHandlerResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-najd/universal-media-tracker-sdk",
3
- "version": "0.1.11",
3
+ "version": "0.2.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [