@luminocity/lemonate-gateway 8.0.5 → 8.0.6-dev1

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
@@ -2,9 +2,12 @@ import moment from 'moment';
2
2
  import { AxiosInstance, ResponseType } from 'axios';
3
3
  import WebSocket from 'isomorphic-ws';
4
4
  import FormData from 'form-data';
5
+ import { CustomField as CustomField$1, CustomFieldDefinition as CustomFieldDefinition$1 } from '@/repo/CustomField';
5
6
  import { WebsocketProvider } from 'y-websocket';
6
7
  import * as awarenessProtocol from 'y-protocols/awareness';
7
8
  import { CollabDocument } from '@/collabstate/CollabDocument';
9
+ import { ScriptItem as ScriptItem$1, Script as Script$1 } from '@/repo/Script';
10
+ import { ScriptField as ScriptField$1 } from '@/repo/ScriptField';
8
11
 
9
12
  declare class Snapshot {
10
13
  id: string;
@@ -265,7 +268,6 @@ declare class AggregatedItem extends Item {
265
268
  }[];
266
269
  fields?: any[];
267
270
  userFields?: any[];
268
- additionalUserAttributes?: Record<string, unknown>;
269
271
  readonly isAggregatedItem: boolean;
270
272
  constructor(data: any);
271
273
  }
@@ -969,7 +971,7 @@ declare class Field extends Snapshotable {
969
971
  setLabelType(value: string): void;
970
972
  createSnapshot(dontRecurseIntoBlocks?: boolean): Snapshot;
971
973
  restoreFromSnapshot(snapshot: Snapshot): void;
972
- rollbackFromSnapshot(snapshot: any): void;
974
+ rollbackFromSnapshot(snapshot: Snapshot): void;
973
975
  }
974
976
 
975
977
  declare class PreparedItem extends AggregatedItem {
@@ -983,15 +985,19 @@ declare class PreparedItem extends AggregatedItem {
983
985
  isDirty: boolean;
984
986
  fieldInstances: Field[];
985
987
  userFieldInstances: Field[];
988
+ customFieldInstances: CustomField$1[];
986
989
  packageContent?: PreparedItem;
987
990
  packageType?: string;
988
991
  public: boolean;
989
992
  readOnly: boolean;
990
993
  isPackaged: boolean;
994
+ isGenerated: boolean;
991
995
  packageItem?: PreparedItem;
992
996
  readonly isPreparedItem: boolean;
993
997
  resultingAcl?: Acl;
994
998
  constructor(data: any);
999
+ createCustomFieldInstances(definitions: CustomFieldDefinition$1[]): void;
1000
+ addCustomField(customField: CustomField$1): void;
995
1001
  markDirty(): void;
996
1002
  makeIdsUnique(): void;
997
1003
  clone(makeIdsUnique?: boolean): PreparedItem;
@@ -3919,7 +3925,7 @@ declare class ApiGateway {
3919
3925
  declare class ItemChangeProcessor {
3920
3926
  updateItemLinksAndAttributes(item: PreparedItem, includeLinkItems: boolean, clearUnusedLinks: boolean): void;
3921
3927
  getLinksAndAttributes(item: PreparedItem, links: Array<any>, attributes: object, userAttributes: object, includeItems: boolean, clearUnusedLinks: boolean): void;
3922
- retrieveLinksAndAttributesFromFieldInstances(fieldInstances: Array<any>, links: Array<any>, attributes: object, includeLinkItems: boolean, clearUnusedLinks: boolean): void;
3928
+ retrieveLinksAndAttributesFromFieldInstances(fieldInstances: Array<any>, links: Array<any>, attributes: object, includeLinkItems: boolean, clearUnusedLinks: boolean, fieldPrefix?: string): void;
3923
3929
  traverseTreeFieldInstance(blocks: Array<any>, links: Array<any>, attributes: object, path: string, includeLinkItems: boolean): void;
3924
3930
  traverseListFieldInstances(blocks: Array<any>, links: Array<any>, attributes: object, path: string, includeLinkItems: boolean): void;
3925
3931
  processScripts(scripts: Array<any>, links: Array<any>, attributes: object, path: string, includeLinkItems: boolean): void;
@@ -3932,6 +3938,7 @@ declare class ItemPreparator {
3932
3938
  setItemFetcher(itemFetcher: Function): void;
3933
3939
  setFieldsFromDatatypes(item: PreparedItem): void;
3934
3940
  prepare(item: any): Promise<PreparedItem>;
3941
+ createCustomFieldInstances(item: PreparedItem, attributes: Record<string, unknown>, prefix?: string): Promise<CustomField$1[]>;
3935
3942
  createFieldInstances(item: PreparedItem, fields: any[], attributes: Record<string, unknown>, path: string, attributeSrc: string, doNotFillValues?: boolean): Promise<Field[]>;
3936
3943
  getFieldSet(item: PreparedItem, name: string): {
3937
3944
  name: string;
@@ -4132,6 +4139,7 @@ declare class ItemRepo {
4132
4139
  loadItemByRelativePath(itemId: string, path: string, options?: any): Promise<PreparedItem | undefined>;
4133
4140
  _loadItemFromApi(id: string, options?: any): Promise<any[]>;
4134
4141
  _relinkItems(items: PreparedItem[], referenceMap: Map<string, PreparedItem>): void;
4142
+ createItem(typeName: string, attributes: any): Promise<PreparedItem>;
4135
4143
  /**
4136
4144
  *
4137
4145
  * @param id
@@ -4159,6 +4167,7 @@ declare class ItemRepo {
4159
4167
  id: any;
4160
4168
  newName: any;
4161
4169
  }): void;
4170
+ isItemKnown(itemId: string): boolean;
4162
4171
  invalidateId(itemId: string): void;
4163
4172
  }
4164
4173
 
@@ -4178,7 +4187,7 @@ declare class ProxyEvent {
4178
4187
  length?: number;
4179
4188
  position?: number;
4180
4189
  elementsToDelete?: any[];
4181
- field?: Field;
4190
+ field?: string;
4182
4191
  fieldId?: string;
4183
4192
  isLink?: boolean;
4184
4193
  bundleIndex: number;
@@ -4193,7 +4202,7 @@ declare class ProxyEvent {
4193
4202
  setRange(start: number, length: number): void;
4194
4203
  setPosition(position: number): void;
4195
4204
  setElementsToDelete(elements: any[]): void;
4196
- setField(field: Field): void;
4205
+ setField(field: string): void;
4197
4206
  setFieldId(id: string): void;
4198
4207
  setIsLink(isLink: boolean): void;
4199
4208
  clone(): ProxyEvent & this;
@@ -4224,6 +4233,7 @@ declare class UndoManager {
4224
4233
  rollbackFromSnapshot(id: string): void;
4225
4234
  _grabSnapshot(item: PreparedItem): Snapshot;
4226
4235
  _getFieldInstance(item: PreparedItem, id: string): Field | null;
4236
+ _getCustomFieldInstance(item: PreparedItem, id: string): CustomField | null;
4227
4237
  _rollbackFromSnapshot(item: PreparedItem, snapshot: Snapshot): void;
4228
4238
  getEnabled(): boolean;
4229
4239
  setEnabled(value: boolean): void;
@@ -4284,13 +4294,17 @@ declare class Proxifier {
4284
4294
  proxyItemField(field: Field, item: any): any;
4285
4295
  proxyGraphBlockField(field: Field, block: Block, item: PreparedItem): any;
4286
4296
  proxyBlockField(field: Field, block: Block, item: PreparedItem): any;
4287
- proxyScriptItem(scriptItem: any, script: any, item: any): any;
4288
- proxyScriptFieldsArray(fields: any, script: any, item: any): any[];
4289
- proxyScriptField(field: any, script: any, item: any): any;
4297
+ proxyScriptItem(scriptItem: ScriptItem$1, script: Script$1, item: PreparedItem): any;
4298
+ proxyScriptFieldsArray(fields: ScriptField$1[], script: Script$1, item: PreparedItem): any[];
4299
+ proxyScriptField(field: ScriptField$1, script: Script$1, item: PreparedItem): any;
4300
+ proxyCustomFieldsArray(fields: CustomField$1[], item: PreparedItem): any[];
4301
+ proxyCustomField(field: CustomField$1, item: PreparedItem): any;
4290
4302
  }
4291
4303
 
4292
4304
  declare const _default: {
4305
+ createItemOrBlockID: () => string;
4293
4306
  createGUID: () => string;
4307
+ createGeneratedItemId: () => string;
4294
4308
  toUserFriendlyName: (variableName: string) => string;
4295
4309
  assert: (value: any, msg: string) => void;
4296
4310
  matchItemIdAndObject(value1: any, value2: any): boolean;
@@ -12161,5 +12175,33 @@ declare function getDatatypes(): ({
12161
12175
  declare function verifyAcl(userInfo: any, acls: any, action: string): true | undefined;
12162
12176
  declare function hasPermission(userInfo: any, perm: any, needsSuperadmin: boolean): boolean;
12163
12177
 
12164
- export { AccessDeniedException, AggregatedItem, ApiClient, ApiGateway, Block, EventEmitter, Field, InvalidArgumentException, InvalidStateException, Item, ItemCache$1 as ItemCache, ItemRepo, ItemVisibility, LinkableItemsCache, LoaderException, Package as PackageTools, PreparedItem, Profiler, Proxifier, ProxyEvent, QuotaExceededException, Script, ScriptField, Snapshot, Storage, Template, ThumbCache, UndoManager, eventBus, getDatatypeByName, getDatatypes, hasPermission, _default as tools, verifyAcl };
12165
- export type { Acl, Attachments, BaseBlogArticle, ConversationEntry, FolderListingOptions, FolderListingWithOptions, ItemOptions, ItemQueryOptions, ItemQueryWithOptions, ItemWithOptions, JobState, Me, ProgressCallback, UserInfo };
12178
+ type CustomFieldDefinition = {
12179
+ name: string;
12180
+ defaultValue: any;
12181
+ type: string;
12182
+ };
12183
+ declare class CustomField extends Snapshotable {
12184
+ id: string;
12185
+ name: string | undefined;
12186
+ displayName: string | undefined;
12187
+ value: any;
12188
+ type: string | undefined;
12189
+ datatype: string | undefined;
12190
+ linkableTypes: string[];
12191
+ order: number;
12192
+ constructor(name?: string | undefined, value?: any | undefined, item?: PreparedItem | undefined);
12193
+ getId(): string;
12194
+ setName(name: string | undefined): void;
12195
+ setType(name: string): void;
12196
+ setOrder(order: number): void;
12197
+ clone(fieldOverrides?: Map<string, string>): CustomField;
12198
+ clearDefinition(): void;
12199
+ setDefinition(def: any): void;
12200
+ _toBoolean(value: any): any;
12201
+ _updateDisplayName(): void;
12202
+ createSnapshot(): Snapshot;
12203
+ rollbackFromSnapshot(snapshot: Snapshot): void;
12204
+ }
12205
+
12206
+ export { AccessDeniedException, AggregatedItem, ApiClient, ApiGateway, Block, CustomField, EventEmitter, Field, InvalidArgumentException, InvalidStateException, Item, ItemCache$1 as ItemCache, ItemRepo, ItemVisibility, LinkableItemsCache, LoaderException, Package as PackageTools, PreparedItem, Profiler, Proxifier, ProxyEvent, QuotaExceededException, Script, ScriptField, Snapshot, Storage, Template, ThumbCache, UndoManager, eventBus, getDatatypeByName, getDatatypes, hasPermission, _default as tools, verifyAcl };
12207
+ export type { Acl, Attachments, BaseBlogArticle, ConversationEntry, CustomFieldDefinition, FolderListingOptions, FolderListingWithOptions, ItemOptions, ItemQueryOptions, ItemQueryWithOptions, ItemWithOptions, JobState, Me, ProgressCallback, UserInfo };