@overmap-ai/core 1.0.78-procedures.4 → 1.0.78-procedures.6

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,5 +1,6 @@
1
- import { Created, Form, FormRevision, Organization, Payload, Stored } from '../../typings';
1
+ import { Form, Organization, Payload, Stored, UUID } from '../../typings';
2
2
  import { BaseSDK } from '../base';
3
+ import { OptimisticModelResult } from '../typings';
3
4
  import { OvermapRootState } from '../../store';
4
5
  import { BaseOfflineModelApiService } from './BaseOfflineModelApiService';
5
6
  export declare abstract class FormService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseOfflineModelApiService<Form["uuid"], Form, TState, TSDK> {
@@ -20,7 +21,8 @@ export declare abstract class FormService<TState extends OvermapRootState, TSDK
20
21
  selectById: import('../..').OvermapSelectorWithArgs<string, Stored<Form> | undefined>;
21
22
  selectByIds: (uuids: string[]) => (state: any) => Stored<Form>[];
22
23
  };
23
- add(payload: Payload<Form>, initialRevision: Pick<FormRevision, "title" | "description" | "fields">): [Stored<Form>, Stored<FormRevision>, Promise<Created<FormRevision>>];
24
+ add(payload: Payload<Form>): OptimisticModelResult<Form>;
25
+ update(payload: UUID<Partial<Payload<Form>>>): OptimisticModelResult<Form>;
24
26
  delete(uuid: Form["uuid"]): Promise<undefined>;
25
27
  refreshStore(organizationUuid: Organization["uuid"], signal?: AbortSignal): Promise<Form[]>;
26
28
  }
@@ -1,4 +1,4 @@
1
- import { Organization, Payload, Stored, UUID, ProcedureStep } from '../../typings';
1
+ import { Organization, Payload, ProcedureStep, Stored, UUID } from '../../typings';
2
2
  import { BaseSDK } from '../base';
3
3
  import { OptimisticModelResult } from '../typings';
4
4
  import { OvermapRootState } from '../../store';
@@ -146,4 +146,3 @@ export declare const selectProcedureSteps: ((state: {
146
146
  export declare const selectProcedureStepsMappingOfProcedureType: OvermapSelectorWithArgs<ProcedureType["uuid"], Record<string, Stored<ProcedureStep>>>;
147
147
  export declare const selectProcedureStepsOfProcedureType: OvermapSelectorWithArgs<ProcedureType["uuid"], Stored<ProcedureStep>[]>;
148
148
  export declare const selectProcedureStepsByIds: (uuids: string[]) => (state: any) => Stored<ProcedureStep>[];
149
- export declare const selectDescendantsOfProcedureStep: (uuid: string) => (state: any) => Stored<ProcedureStep>[];
@@ -3,15 +3,16 @@ import { FieldsAttachmentModel, FieldsModel, FieldValuesAttachmentModel, FieldVa
3
3
  import { Organization } from './organizations';
4
4
  export interface Form extends UUIDModel, TimestampedModel, SubmittedAtModel, CreatedByModel {
5
5
  organization: Organization["uuid"];
6
+ name: string;
7
+ description: string | null;
6
8
  }
7
9
  export interface FormRevision extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldsModel {
8
10
  form: Form["uuid"];
9
- title: string;
10
- description: string | null;
11
11
  }
12
12
  export type FormRevisionPayload = Omit<Payload<FormRevision>, "revision">;
13
13
  export interface FormSubmission extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldValuesModel, IndexedModel {
14
14
  form_revision: FormRevision["uuid"];
15
+ form: Form["uuid"];
15
16
  }
16
17
  export interface FormSubmissionAttachment extends UUIDModel, SubmittedAtModel, TimestampedModel, CreatedByModel, FieldValuesAttachmentModel {
17
18
  form_submission: FormSubmission["uuid"];
@@ -1,7 +1,7 @@
1
1
  import { SerializedCondition } from '@overmap-ai/forms';
2
2
  import { RequiredFileModel } from '../files';
3
3
  import { Asset, AssetType } from './assets';
4
- import { AbbreviationModel, ColorModel, CreatedByModel, IconModel, IndexedModel, SubmittedAtModel, TimestampedModel, TreeModel, UUIDModel } from './base';
4
+ import { AbbreviationModel, ColorModel, CreatedByModel, IconModel, IndexedModel, SubmittedAtModel, TimestampedModel, UUIDModel } from './base';
5
5
  import { FieldsAttachmentModel, FieldsModel, FieldValuesModel } from './fields';
6
6
  import { Issue, IssueType } from './issues';
7
7
  import { Organization } from './organizations';
@@ -18,7 +18,7 @@ export interface ProcedureType extends UUIDModel, TimestampedModel, SubmittedAtM
18
18
  export interface ProcedureTypeAttachment extends UUIDModel, TimestampedModel, SubmittedAtModel, RequiredFileModel, CreatedByModel {
19
19
  procedure_type: ProcedureType["uuid"];
20
20
  }
21
- export interface ProcedureStep extends UUIDModel, TimestampedModel, ColorModel, SubmittedAtModel, CreatedByModel, TreeModel<string> {
21
+ export interface ProcedureStep extends UUIDModel, TimestampedModel, ColorModel, SubmittedAtModel, CreatedByModel {
22
22
  procedure_type: ProcedureType["uuid"];
23
23
  name: string;
24
24
  order: number;
@@ -1,4 +1,3 @@
1
1
  export * from './assets';
2
2
  export * from './issues';
3
3
  export * from './documents';
4
- export * from './procedures';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overmap-ai/core",
3
- "version": "1.0.78-procedures.4",
3
+ "version": "1.0.78-procedures.6",
4
4
  "description": "Core functionality for Overmap",
5
5
  "keywords": [
6
6
  "components",
@@ -1,4 +0,0 @@
1
- import { Tree } from 'ts-tree-lib';
2
- import { ProcedureStep, Stored } from '../../typings';
3
- export declare const getProcedureStepTrees: (procedureSteps: Stored<ProcedureStep>[]) => Tree<Stored<ProcedureStep>>[];
4
- export declare const getProcedureStepSubTree: (uuid: ProcedureStep["uuid"], procedureSteps: Stored<ProcedureStep>[]) => Tree<Stored<ProcedureStep>>;