@pitcher/js-api 1.25.0-beta.0 → 1.25.0-beta.2

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.
@@ -1,7 +1,8 @@
1
1
  type __VLS_Props = {
2
- checked: boolean;
2
+ checked?: boolean;
3
3
  disabled?: boolean;
4
4
  themeOverrides?: Record<string, any>;
5
+ size?: string;
5
6
  };
6
7
  declare function __VLS_template(): {
7
8
  attrs: Partial<{}>;
@@ -12,8 +13,10 @@ declare function __VLS_template(): {
12
13
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
14
  declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
15
  change: (value: boolean) => any;
16
+ "update:checked": (value: boolean) => any;
15
17
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
16
18
  onChange?: ((value: boolean) => any) | undefined;
19
+ "onUpdate:checked"?: ((value: boolean) => any) | undefined;
17
20
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
18
21
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
19
22
  export default _default;
@@ -15,5 +15,5 @@ export declare function useCanvasesManagementFiltersToolbar(filters: Ref<Filters
15
15
  isAnyFilterActive: import('vue').ComputedRef<boolean>;
16
16
  showClearFilters: import('vue').ComputedRef<boolean>;
17
17
  clearFilters: () => void;
18
- updateFilters: (filterName: string, newValue: string | string[] | boolean) => void;
18
+ updateFilters: (filterName: string, newValue: string | string[] | boolean | null) => void;
19
19
  };
@@ -1,7 +1,7 @@
1
1
  type Props = {
2
2
  disabled?: boolean;
3
3
  name?: string;
4
- modelValue?: boolean | null;
4
+ modelValue?: boolean | string | null;
5
5
  };
6
6
  declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
7
7
  "update:modelValue": (value: boolean) => any;
@@ -1,10 +1,10 @@
1
1
  declare const _default: <FilterValue extends string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
2
2
  props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
3
- readonly "onUpdate:modelValue"?: ((v: "" | FilterValue | FilterValue[]) => any) | undefined;
3
+ readonly "onUpdate:modelValue"?: ((v: "" | FilterValue | FilterValue[] | null) => any) | undefined;
4
4
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue"> & {
5
5
  disabled?: boolean;
6
6
  name?: string;
7
- modelValue: FilterValue[] | FilterValue | "";
7
+ modelValue: FilterValue[] | FilterValue | null | "";
8
8
  inline?: boolean;
9
9
  options: {
10
10
  label: string;
@@ -17,7 +17,7 @@ declare const _default: <FilterValue extends string>(__VLS_props: NonNullable<Aw
17
17
  slots: {
18
18
  footer?(_: {}): any;
19
19
  };
20
- emit: (e: "update:modelValue", v: "" | FilterValue | FilterValue[]) => void;
20
+ emit: (e: "update:modelValue", v: "" | FilterValue | FilterValue[] | null) => void;
21
21
  }>) => import('vue').VNode & {
22
22
  __ctx?: Awaited<typeof __VLS_setup>;
23
23
  };
@@ -210,6 +210,7 @@ export declare function createHighLevelApi(options?: ApiOptions): {
210
210
  message: string;
211
211
  }): Promise<void>;
212
212
  query(payload: import('../payload.types').QueryPayload): Promise<any>;
213
+ getFolders(payload: import('../payload.types').FolderListRequest): Promise<import('../../main.lib').PaginatedFolderList>;
213
214
  getFolder(payload?: {
214
215
  id: import('../../main.lib').FolderRetrieve["id"];
215
216
  }): Promise<import('../../main.lib').FolderRetrieve>;
@@ -0,0 +1,17 @@
1
+ import { AdminCaptureAppErrorRequest } from './types.admin';
2
+ /**
3
+ * Send an app error to Pitcher sentry instance.
4
+ *
5
+ * @example
6
+ * try {
7
+ * throw new Error('This is an error')
8
+ * } catch (error) {
9
+ * useAdmin().captureAppError({
10
+ * error,
11
+ * message: 'This is an app error',
12
+ * })
13
+ * }
14
+ *
15
+ * @param payload error object to send to Pitcher sentry instance
16
+ */
17
+ export declare function captureAppError(payload: AdminCaptureAppErrorRequest): Promise<void>;
@@ -59,6 +59,7 @@ declare const _default: {
59
59
  selectCollectionContent(payload?: import('./types.admin').AdminSelectCollectionPlayerRequest): Promise<import('./types.admin').AdminSelectCollectionPlayerResponse>;
60
60
  selectAgendaContent(payload?: import('./types.admin').AdminSelectAgendaRequest): Promise<import('./types.admin').AdminSelectAgendaResponse>;
61
61
  selectContent(payload: import('./types.admin').AdminSelectContentRequest): Promise<import('./types.admin').AdminSelectContentResponse>;
62
+ captureAppError(payload: import('./types.admin').AdminCaptureAppErrorRequest): Promise<void>;
62
63
  on: typeof on;
63
64
  toast: typeof toast;
64
65
  };
@@ -17,6 +17,7 @@ export declare const ADMIN_API_TYPES: {
17
17
  readonly ADMIN_RESPONSE: "ADMIN_RESPONSE";
18
18
  };
19
19
  export declare const ADMIN_API_METHOD_TYPES: {
20
+ readonly CAPTURE_APP_ERROR: "admin_capture_app_error";
20
21
  readonly CREATE_CANVAS: "admin_create_canvas";
21
22
  readonly GET_APP_CONFIG: "admin_get_app_config";
22
23
  readonly GET_CANVAS: "admin_get_canvas";
@@ -38,6 +39,10 @@ export declare const ADMIN_API_METHOD_TYPES: {
38
39
  export type AdminMessagePayloads = {
39
40
  [ADMIN_MESSAGE_TYPES.ENV_CHANGED]: AdminEnv;
40
41
  };
42
+ /**
43
+ * Error object to send to Pitcher sentry instance
44
+ */
45
+ export type AdminCaptureAppErrorRequest = Record<string, any>;
41
46
  /**
42
47
  * Represents an admin request with a specific payload.
43
48
  * @template Payload - The type of the payload data.
@@ -173,6 +178,10 @@ export type AdminSelectCanvasesRequest = {
173
178
  * Initial metadata filters to apply to the picker (optional).
174
179
  */
175
180
  initial_metadata_filters?: Record<string, any>;
181
+ /**
182
+ * The sequencing key to use for ordering the canvases (optional).
183
+ */
184
+ sequencing_key?: string;
176
185
  };
177
186
  export type AdminSelectCanvasesResponse = {
178
187
  /** User action result */
@@ -1,4 +1,11 @@
1
- import { File, Folder, FolderRetrieve, FolderCreateRequest, FolderUpdateRequest } from '../../../../types/openapi';
1
+ import { File, Folder, FolderRetrieve, FolderCreateRequest, FolderUpdateRequest, PaginatedFolderList } from '../../../../types/openapi';
2
+ import { FolderListRequest } from '../../payload.types';
3
+ /**
4
+ * Retrieves a list of folders.
5
+ * @param payload - The payload containing the search, ordering, filters, fields, name, page, and page_size.
6
+ * @returns A promise that resolves to the list of folders.
7
+ */
8
+ export declare function getFolders(payload: FolderListRequest): Promise<PaginatedFolderList>;
2
9
  /**
3
10
  * Retrieves a folder by its ID.
4
11
  * @param payload - An object containing the folder ID.
package/lib/sdk/main.d.ts CHANGED
@@ -129,6 +129,7 @@ export declare function useAdmin(): {
129
129
  selectCollectionContent(payload?: import('./api/modules/admin/types.admin').AdminSelectCollectionPlayerRequest): Promise<import('./api/modules/admin/types.admin').AdminSelectCollectionPlayerResponse>;
130
130
  selectAgendaContent(payload?: import('./api/modules/admin/types.admin').AdminSelectAgendaRequest): Promise<import('./api/modules/admin/types.admin').AdminSelectAgendaResponse>;
131
131
  selectContent(payload: import('./api/modules/admin/types.admin').AdminSelectContentRequest): Promise<import('./api/modules/admin/types.admin').AdminSelectContentResponse>;
132
+ captureAppError(payload: import('./api/modules/admin/types.admin').AdminCaptureAppErrorRequest): Promise<void>;
132
133
  on: (type: typeof import('./api/modules/admin/types.admin').ADMIN_MESSAGE_TYPES[keyof typeof import('./api/modules/admin/types.admin').ADMIN_MESSAGE_TYPES], handler: (data: import('./api/modules/admin/types.admin').AdminMessagePayloads[typeof type]) => Promise<void>) => Promise<() => void>;
133
134
  toast: (payload: import('./api/modules/admin/types.admin').AdminToastRequest) => Promise<void>;
134
135
  };
@@ -286,6 +287,7 @@ export declare function useApi(options?: ApiOptions): {
286
287
  message: string;
287
288
  }): Promise<void>;
288
289
  query(payload: import('./payload.types').QueryPayload): Promise<any>;
290
+ getFolders(payload: import('./payload.types').FolderListRequest): Promise<import('../main.lib').PaginatedFolderList>;
289
291
  getFolder(payload?: {
290
292
  id: import('../main.lib').FolderRetrieve["id"];
291
293
  }): Promise<import('../main.lib').FolderRetrieve>;
@@ -379,6 +381,7 @@ export declare function useApi(options?: ApiOptions): {
379
381
  selectCollectionContent(payload?: import('./api/modules/admin/types.admin').AdminSelectCollectionPlayerRequest): Promise<import('./api/modules/admin/types.admin').AdminSelectCollectionPlayerResponse>;
380
382
  selectAgendaContent(payload?: import('./api/modules/admin/types.admin').AdminSelectAgendaRequest): Promise<import('./api/modules/admin/types.admin').AdminSelectAgendaResponse>;
381
383
  selectContent(payload: import('./api/modules/admin/types.admin').AdminSelectContentRequest): Promise<import('./api/modules/admin/types.admin').AdminSelectContentResponse>;
384
+ captureAppError(payload: import('./api/modules/admin/types.admin').AdminCaptureAppErrorRequest): Promise<void>;
382
385
  on: (type: typeof import('./api/modules/admin/types.admin').ADMIN_MESSAGE_TYPES[keyof typeof import('./api/modules/admin/types.admin').ADMIN_MESSAGE_TYPES], handler: (data: import('./api/modules/admin/types.admin').AdminMessagePayloads[typeof type]) => Promise<void>) => Promise<() => void>;
383
386
  toast: (payload: import('./api/modules/admin/types.admin').AdminToastRequest) => Promise<void>;
384
387
  } | {
@@ -555,6 +558,7 @@ export declare function useApi(options?: ApiOptions): {
555
558
  message: string;
556
559
  }): Promise<void>;
557
560
  query(payload: import('./payload.types').QueryPayload): Promise<any>;
561
+ getFolders(payload: import('./payload.types').FolderListRequest): Promise<import('../main.lib').PaginatedFolderList>;
558
562
  getFolder(payload?: {
559
563
  id: import('../main.lib').FolderRetrieve["id"];
560
564
  }): Promise<import('../main.lib').FolderRetrieve>;
@@ -755,6 +759,7 @@ export declare function useApi(options?: ApiOptions): {
755
759
  };
756
760
  }): Promise<ArrayBuffer>;
757
761
  query(payload: import('./payload.types').QueryPayload): Promise<any>;
762
+ getFolders(payload: import('./payload.types').FolderListRequest): Promise<import('../main.lib').PaginatedFolderList>;
758
763
  getFolder(payload?: {
759
764
  id: import('../main.lib').FolderRetrieve["id"];
760
765
  }): Promise<import('../main.lib').FolderRetrieve>;
@@ -234,3 +234,13 @@ export type ShareResponse = {
234
234
  */
235
235
  activity_type?: string;
236
236
  };
237
+ export type FolderListRequest = {
238
+ search?: string;
239
+ ordering?: string;
240
+ filters?: Record<string, any>;
241
+ fields?: string;
242
+ name?: string;
243
+ page?: number;
244
+ page_size?: number;
245
+ id__in?: string[];
246
+ };
@@ -0,0 +1,3 @@
1
+ type WindowType = Window & typeof globalThis;
2
+ export declare function getTopPitcherWindow(current?: WindowType): WindowType;
3
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pitcher/js-api",
3
- "version": "1.25.0-beta.0",
3
+ "version": "1.25.0-beta.2",
4
4
  "type": "module",
5
5
  "main": "js-api.umd.min.js",
6
6
  "module": "js-api.esm.js",