repo_name
string
dataset
string
owner
string
lang
string
func_name
string
code
string
docstring
string
url
string
sha
string
jazz
github_2023
garden-co
typescript
FileStream.toJSON
toJSON(): { id: string; _type: "BinaryCoStream"; mimeType?: string; totalSizeBytes?: number; fileName?: string; chunks?: Uint8Array[]; finished?: boolean; } { return { id: this.id, _type: this._type, ...this.getChunks(), }; }
/** * Get a JSON representation of the `FileStream` * @category Content */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coFeed.ts#L901-L915
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
FileStream.subscribe
subscribe<B extends FileStream, Depth>( this: B, depth: Depth & DepthsIn<B>, listener: (value: DeeplyLoaded<B, Depth>) => void, ): () => void { return subscribeToExistingCoValue(this, depth, listener); }
/** * An instance method to subscribe to an existing `FileStream` * @category Subscription & Loading */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coFeed.ts#L992-L998
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
FileStream.waitForSync
waitForSync(options?: { timeout?: number }) { return this._raw.core.waitForSync(options); }
/** * Wait for the `FileStream` to be uploaded to the other peers. * * @category Subscription & Loading */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coFeed.ts#L1005-L1007
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList.Of
static Of<Item>(item: Item): typeof CoList<Item> { // TODO: cache superclass for item class return class CoListOf extends CoList<Item> { [co.items] = item; }; }
/** * Declare a `CoList` by subclassing `CoList.Of(...)` and passing the item schema using `co`. * * @example * ```ts * class ColorList extends CoList.Of( * co.string * ) {} * class AnimalList extends CoList.Of( * co.ref(Animal) * ) {} * ``` * * @category Declaration */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L70-L75
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList.of
static of(..._args: never): never { throw new Error("Can't use Array.of with CoLists"); }
/** * @ignore * @deprecated Use UPPERCASE `CoList.Of` instead! */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L80-L82
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList._schema
get _schema(): { [ItemsSym]: SchemaFor<Item>; } { return (this.constructor as typeof CoList)._schema; }
/** @internal */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L104-L108
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList._owner
get _owner(): Account | Group { return this._raw.group instanceof RawAccount ? RegisteredSchemas["Account"].fromRaw(this._raw.group) : RegisteredSchemas["Group"].fromRaw(this._raw.group); }
/** @category Collaboration */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L111-L115
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList._refs
get _refs(): { [idx: number]: Exclude<Item, null> extends CoValue ? Ref<UnCo<Exclude<Item, null>>> : never; } & { length: number; [Symbol.iterator](): IterableIterator< Exclude<Item, null> extends CoValue ? Ref<Exclude<Item, null>> : never >; } { return makeRefs<number>( ...
/** * If a `CoList`'s items are a `co.ref(...)`, you can use `coList._refs[i]` to access * the `Ref` instead of the potentially loaded/null value. * * This allows you to always get the ID or load the value manually. * * @example * ```ts * animals._refs[0].id; // => ID<Animal> * animals._refs[...
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L133-L150
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList.create
static create<L extends CoList>( this: CoValueClass<L>, items: UnCo<L[number]>[], options?: { owner: Account | Group } | Account | Group, ) { const { owner } = parseCoValueCreateOptions(options); const instance = new this({ init: items, owner }); const raw = owner._raw.createList( toRawI...
/** * Create a new CoList with the given initial values and owner. * * The owner (a Group or Account) determines access rights to the CoMap. * * The CoList will immediately be persisted and synced to connected peers. * * @example * ```ts * const colours = ColorList.create( * ["red", "gre...
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L221-L241
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList.toJSON
toJSON(_key?: string, seenAbove?: ID<CoValue>[]): any[] { const itemDescriptor = this._schema[ItemsSym] as Schema; if (itemDescriptor === "json") { return this._raw.asArray(); } else if ("encoded" in itemDescriptor) { return this._raw.asArray().map((e) => itemDescriptor.encoded.encode(e)); }...
// eslint-disable-next-line @typescript-eslint/no-explicit-any
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L299-L317
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList.fromRaw
static fromRaw<V extends CoList>( this: CoValueClass<V> & typeof CoList, raw: RawCoList, ) { return new this({ fromRaw: raw }); }
/** @category Internals */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L324-L329
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList.schema
static schema<V extends CoList>( // eslint-disable-next-line @typescript-eslint/no-explicit-any this: { new (...args: any): V } & typeof CoList, def: { [ItemsSym]: V["_schema"][ItemsSym] }, ) { this._schema ||= {}; Object.assign(this._schema, def); }
/** @internal */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L332-L339
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList.ensureLoaded
ensureLoaded<L extends CoList, Depth>( this: L, depth: Depth & DepthsIn<L>, ): Promise<DeeplyLoaded<L, Depth>> { return ensureCoValueLoaded(this, depth); }
/** * Given an already loaded `CoList`, ensure that items are loaded to the specified depth. * * Works like `CoList.load()`, but you don't need to pass the ID or the account to load as again. * * @category Subscription & Loading */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L449-L454
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList.subscribe
subscribe<L extends CoList, Depth>( this: L, depth: Depth & DepthsIn<L>, listener: (value: DeeplyLoaded<L, Depth>) => void, ): () => void { return subscribeToExistingCoValue(this, depth, listener); }
/** * Given an already loaded `CoList`, subscribe to updates to the `CoList` and ensure that items are loaded to the specified depth. * * Works like `CoList.subscribe()`, but you don't need to pass the ID or the account to load as again. * * Returns an unsubscribe function that you should call when you n...
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L465-L471
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList.castAs
castAs<Cl extends CoValueClass & CoValueFromRaw<CoValue>>( cl: Cl, ): InstanceType<Cl> { const casted = cl.fromRaw(this._raw) as InstanceType<Cl>; const subscriptionScope = subscriptionsScopes.get(this); if (subscriptionScope) { subscriptionsScopes.set(casted, subscriptionScope); } retur...
/** @category Type Helpers */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L474-L483
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoList.waitForSync
waitForSync(options?: { timeout?: number }) { return this._raw.core.waitForSync(options); }
/** * Wait for the `CoList` to be uploaded to the other peers. * * @category Subscription & Loading */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coList.ts#L490-L492
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap._schema
get _schema() { return (this.constructor as typeof CoMap)._schema as { [key: string]: Schema; } & { [ItemsSym]?: Schema }; }
/** @internal */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L109-L113
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap._refs
get _refs(): { [Key in CoKeys<this>]: IfCo<this[Key], RefIfCoValue<this[Key]>>; } { return makeRefs<CoKeys<this>>( (key) => this._raw.get(key as string) as unknown as ID<CoValue>, () => { const keys = this._raw.keys().filter((key) => { const schema = this._schema[key ...
/** * If property `prop` is a `co.ref(...)`, you can use `coMaps._refs.prop` to access * the `Ref` instead of the potentially loaded/null value. * * This allows you to always get the ID or load the value manually. * * @example * ```ts * person._refs.pet.id; // => ID<Animal> * person._refs.pet...
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L131-L151
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap.getEditFromRaw
private getEditFromRaw( target: CoMap, rawEdit: { by: RawAccountID | AgentID; tx: CojsonInternalTypes.TransactionID; at: Date; value?: JsonValue | undefined; }, descriptor: Schema, key: string, ) { return { value: descriptor === "json" ? rawEdit....
/** @internal */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L154-L191
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap._edits
get _edits() { const map = this; return new Proxy( {}, { get(_target, key) { const rawEdit = map._raw.lastEditAt(key as string); if (!rawEdit) return undefined; const descriptor = map._schema[ key as keyof typeof map._schema ] as Schema; ...
/** @category Collaboration */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L194-L231
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap.constructor
constructor( // eslint-disable-next-line @typescript-eslint/no-explicit-any options: { fromRaw: RawCoMap } | undefined, ) { super(); if (options) { if ("fromRaw" in options) { Object.defineProperties(this, { id: { value: options.fromRaw.id as unknown as ID<this>, ...
/** @internal */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L234-L255
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap.create
static create<M extends CoMap>( this: CoValueClass<M>, init: Simplify<CoMapInit<M>>, options?: | { owner: Account | Group; unique?: CoValueUniqueness["uniqueness"]; } | Account | Group, ) { const instance = new this(); const { owner, uniqueness } = pa...
/** * Create a new CoMap with the given initial values and owner. * * The owner (a Group or Account) determines access rights to the CoMap. * * The CoMap will immediately be persisted and synced to connected peers. * * @example * ```ts * const person = Person.create({ * name: "Alice", ...
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L275-L299
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap.toJSON
toJSON(_key?: string, seenAbove?: ID<CoValue>[]): any[] { const jsonedFields = this._raw.keys().map((key) => { const tKey = key as CoKeys<this>; const descriptor = (this._schema[tKey] || this._schema[ItemsSym]) as Schema; if (descriptor == "json" || "encode" in descriptor) { retur...
// eslint-disable-next-line @typescript-eslint/no-explicit-any
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L306-L336
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap.rawFromInit
rawFromInit<Fields extends object = Record<string, any>>( init: Simplify<CoMapInit<Fields>> | undefined, owner: Account | Group, uniqueness?: CoValueUniqueness, ) { const rawOwner = owner._raw; const rawInit = {} as { [key in keyof Fields]: JsonValue | undefined; }; if (init) ...
// eslint-disable-next-line @typescript-eslint/no-explicit-any
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L347-L384
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap.Record
static Record<Value>(value: IfCo<Value, Value>) { // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging class RecordLikeCoMap extends CoMap { [ItemsSym] = value; } // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging interface RecordLikeCoMap exte...
/** * Declare a Record-like CoMap schema, by extending `CoMap.Record(...)` and passing the value schema using `co`. Keys are always `string`. * * @example * ```ts * import { co, CoMap } from "jazz-tools"; * * class ColorToFruitMap extends CoMap.Record( * co.ref(Fruit) * ) {} * * // ass...
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L404-L413
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap.ensureLoaded
ensureLoaded<M extends CoMap, Depth>( this: M, depth: Depth & DepthsIn<M>, ): Promise<DeeplyLoaded<M, Depth>> { return ensureCoValueLoaded(this, depth); }
/** * Given an already loaded `CoMap`, ensure that the specified fields are loaded to the specified depth. * * Works like `CoMap.load()`, but you don't need to pass the ID or the account to load as again. * * @category Subscription & Loading */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L542-L547
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap.subscribe
subscribe<M extends CoMap, Depth>( this: M, depth: Depth & DepthsIn<M>, listener: (value: DeeplyLoaded<M, Depth>) => void, ): () => void { return subscribeToExistingCoValue(this, depth, listener); }
/** * Given an already loaded `CoMap`, subscribe to updates to the `CoMap` and ensure that the specified fields are loaded to the specified depth. * * Works like `CoMap.subscribe()`, but you don't need to pass the ID or the account to load as again. * * Returns an unsubscribe function that you should cal...
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L558-L564
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoMap.waitForSync
waitForSync(options?: { timeout?: number }) { return this._raw.core.waitForSync(options); }
/** * Wait for the `CoMap` to be uploaded to the other peers. * * @category Subscription & Loading */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coMap.ts#L601-L603
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoPlainText.load
static load<T extends CoPlainText>( this: CoValueClass<T>, id: ID<T>, as?: Account, ): Promise<T | undefined> { return loadCoValue(this, id, as ?? activeAccountContext.get(), []); }
/** * Load a `CoPlainText` with a given ID, as a given account. * * @category Subscription & Loading */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coPlainText.ts#L122-L128
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoPlainText.subscribe
subscribe<T extends CoPlainText>( this: T, listener: (value: T) => void, ): () => void { return subscribeToExistingCoValue(this, [], listener); }
/** * Given an already loaded `CoPlainText`, subscribe to updates to the `CoPlainText` and ensure that the specified fields are loaded to the specified depth. * * Works like `CoPlainText.subscribe()`, but you don't need to pass the ID or the account to load as again. * * Returns an unsubscribe function t...
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coPlainText.ts#L210-L215
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
Mark.validatePositions
validatePositions( textLength: number, idxAfter: (pos: TextPos) => number | undefined, idxBefore: (pos: TextPos) => number | undefined, ) { if (!textLength) { console.error("Cannot validate positions for empty text"); return null; } // Get positions with fallbacks const positi...
/** * Validates and clamps mark positions to ensure they are in the correct order * @returns Normalized positions or null if invalid */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L50-L79
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.createFromPlainText
static createFromPlainText( text: string, options: { owner: Account | Group }, ) { return this.create( { text: CoPlainText.create(text, { owner: options.owner }), marks: CoList.Of(co.ref(Mark)).create([], { owner: options.owner, }), }, { owner: options.o...
/** * Create a CoRichText from plain text. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L138-L151
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.createFromPlainTextAndMark
static createFromPlainTextAndMark< MarkClass extends { // eslint-disable-next-line @typescript-eslint/no-explicit-any new (...args: any[]): Mark; // eslint-disable-next-line @typescript-eslint/no-explicit-any create(init: any, options: { owner: Account | Group }): Mark; }, >( text:...
/** * Create a CoRichText from plain text and a mark. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L156-L177
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.insertAfter
insertAfter(idx: number, text: string) { if (!this.text) throw new Error("Cannot insert into a CoRichText without loaded text"); this.text.insertAfter(idx, text); }
/** * Insert text at a specific index. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L182-L186
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.deleteRange
deleteRange(range: { from: number; to: number }) { if (!this.text) throw new Error("Cannot delete from a CoRichText without loaded text"); this.text.deleteRange(range); }
/** * Delete a range of text. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L191-L195
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.posBefore
posBefore(idx: number): TextPos | undefined { if (!this.text) throw new Error( "Cannot get posBefore in a CoRichText without loaded text", ); return this.text.posBefore(idx); }
/** * Get the position of a specific index. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L200-L206
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.posAfter
posAfter(idx: number): TextPos | undefined { if (!this.text) throw new Error( "Cannot get posAfter in a CoRichText without loaded text", ); return this.text.posAfter(idx); }
/** * Get the position of a specific index. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L211-L217
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.idxBefore
idxBefore(pos: TextPos): number | undefined { if (!this.text) throw new Error( "Cannot get idxBefore in a CoRichText without loaded text", ); return this.text.idxBefore(pos); }
/** * Get the index of a specific position. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L222-L228
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.idxAfter
idxAfter(pos: TextPos): number | undefined { if (!this.text) throw new Error( "Cannot get idxAfter in a CoRichText without loaded text", ); return this.text.idxAfter(pos); }
/** * Get the index of a specific position. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L233-L239
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.insertMark
insertMark< MarkClass extends { new (...args: any[]): Mark; create(init: any, options: { owner: Account | Group }): Mark; }, >( start: number, end: number, RangeClass: MarkClass, extraArgs: Omit< CoMapInit<InstanceType<MarkClass>>, "startAfter" | "startBefore" | "endAft...
/** * Insert a mark at a specific range. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L244-L286
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.removeMark
removeMark< MarkClass extends { new (...args: any[]): Mark; create(init: any, options: { owner: Account | Group }): Mark; }, >( start: number, end: number, RangeClass: MarkClass, options: { tag: string }, ) { if (!this.marks) { throw new Error("Cannot remove marks witho...
/** * Remove a mark at a specific range. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L291-L384
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.resolveMarks
resolveMarks(): ResolvedMark[] { if (!this.text || !this.marks) { throw new Error("Cannot resolve ranges without loaded text and ranges"); } const textLength = this.length; return this.marks.flatMap((mark) => { if (!mark) return []; const positions = mark.validatePositions( ...
/** * Resolve the positions of all marks. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L389-L414
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.resolveAndDiffuseMarks
resolveAndDiffuseMarks(): ResolvedAndDiffusedMark[] { return this.resolveMarks().flatMap((range) => [ ...(range.startAfter < range.startBefore - 1 ? [ { start: range.startAfter, end: range.startBefore - 1, side: "uncertainStart" as const, ...
/** * Resolve and diffuse the positions of all marks. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L419-L448
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.resolveAndDiffuseAndFocusMarks
resolveAndDiffuseAndFocusMarks(): ResolvedAndFocusedMark[] { // for now we only keep the certainMiddle ranges return this.resolveAndDiffuseMarks().filter( (range) => range.side === "certainMiddle", ); }
/** * Resolve, diffuse, and focus the positions of all marks. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L453-L458
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.toTree
toTree(tagPrecedence: string[]): TreeNode { const ranges = this.resolveAndDiffuseAndFocusMarks(); // Convert a bunch of (potentially overlapping) ranges into a tree // - make sure we include all text in leaves, even if it's not covered by a range // - we split overlapping ranges in a way where the high...
/** * Convert a CoRichText to a tree structure useful for client libraries. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L463-L523
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoRichText.toString
toString() { if (!this.text) return ""; return this.text.toString(); }
/** * Convert a CoRichText to plain text. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/coRichText.ts#L532-L535
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
Group.constructor
constructor(options: { fromRaw: RawGroup } | { owner: Account | Group }) { super(); let raw: RawGroup; if (options && "fromRaw" in options) { raw = options.fromRaw; } else { const initOwner = options.owner; if (!initOwner) throw new Error("No owner provided"); if (initOwner._typ...
/** @deprecated Don't use constructor directly, use .create */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/group.ts#L103-L129
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
Group.ensureLoaded
ensureLoaded<G extends Group, Depth>( this: G, depth: Depth & DepthsIn<G>, ): Promise<DeeplyLoaded<G, Depth>> { return ensureCoValueLoaded(this, depth); }
/** @category Subscription & Loading */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/group.ts#L244-L249
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
Group.subscribe
subscribe<G extends Group, Depth>( this: G, depth: Depth & DepthsIn<G>, listener: (value: DeeplyLoaded<G, Depth>) => void, ): () => void { return subscribeToExistingCoValue(this, depth, listener); }
/** @category Subscription & Loading */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/group.ts#L252-L258
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
Group.waitForSync
waitForSync(options?: { timeout?: number }) { return this._raw.core.waitForSync(options); }
/** * Wait for the `Group` to be uploaded to the other peers. * * @category Subscription & Loading */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/group.ts#L265-L267
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoValueBase._loadedAs
get _loadedAs() { const rawAccount = this._raw.core.node.account; if (rawAccount instanceof RawAccount) { return coValuesCache.get(rawAccount, () => RegisteredSchemas["Account"].fromRaw(rawAccount), ); } return new AnonymousJazzAgent(this._raw.core.node); }
/** @private */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/interfaces.ts#L107-L117
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoValueBase.constructor
constructor(..._args: any) { Object.defineProperty(this, "_instanceID", { value: `instance-${Math.random().toString(36).slice(2)}`, enumerable: false, }); }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/interfaces.ts#L120-L125
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoValueBase.fromRaw
static fromRaw<V extends CoValue>(this: CoValueClass<V>, raw: RawCoValue): V { return new this({ fromRaw: raw }); }
/** @category Internals */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/interfaces.ts#L128-L130
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoValueBase.toJSON
toJSON(): object | any[] | string { return { id: this.id, type: this._type, error: "unknown CoValue class", }; }
// eslint-disable-next-line @typescript-eslint/no-explicit-any
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/interfaces.ts#L133-L139
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
CoValueBase.castAs
castAs<Cl extends CoValueClass & CoValueFromRaw<CoValue>>( cl: Cl, ): InstanceType<Cl> { const casted = cl.fromRaw(this._raw) as InstanceType<Cl>; const subscriptionScope = subscriptionsScopes.get(this); if (subscriptionScope) { subscriptionsScopes.set(casted, subscriptionScope); } retur...
/** @category Type Helpers */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/packages/jazz-tools/src/coValues/interfaces.ts#L146-L155
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
AccountRoot.age
get age() { if (!this.dateOfBirth) return null; return new Date().getFullYear() - this.dateOfBirth.getFullYear(); }
// Add private fields here
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/starters/react-passkey-auth/src/schema.ts#L27-L31
617ea91a130d64560624421d5e02af198b2d2086
jazz
github_2023
garden-co
typescript
JazzAccount.migrate
migrate(this: JazzAccount) { if (this.root === undefined) { const group = Group.create(); this.root = AccountRoot.create( { dateOfBirth: new Date("1/1/1990"), }, group, ); } }
/** The account migration is run on account creation and on every log-in. * You can use it to set up the account root and any other initial CoValues you need. */
https://github.com/garden-co/jazz/blob/617ea91a130d64560624421d5e02af198b2d2086/starters/react-passkey-auth/src/schema.ts#L41-L52
617ea91a130d64560624421d5e02af198b2d2086
metasign
github_2023
ncc-erp
typescript
ContractTemplateComponent.convertPDFToImageStrings
convertPDFToImageStrings(base64PDF: string): Promise<any[]> { return new Promise(async (resolve, reject) => { const arrayBuffer = Uint8Array.from(atob(base64PDF), (c) => c.charCodeAt(0) ).buffer; const base64Images = []; const pdf = await pdfjsLib.getDocument(arrayBuffer).promise; ...
// }
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/app/module/admin/contract-template/contract-template.component.ts#L103-L138
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
SignatureDialogComponent.constructor
constructor( public dialogRef: MatDialogRef<any>, @Inject(MAT_DIALOG_DATA) public data: any, public signatureUserService: SignatureUserService, public signerSignatureSettingService: SignerSignatureSettingService, public route: ActivatedRoute, private ecTranslate: EcTranslatePipe, private med...
// private mobileQuery: MediaQueryList;
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/app/module/unauthen-pages/un-authen-signing/signature-dialog/signature-dialog.component.ts#L86-L103
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
SignatureDialogComponent.drop
drop(event: any) { if (this.isMobile) { this.currentFontSize = this.fontSize[3]; } else if (this.isTablet) { this.currentFontSize = this.fontSize[9]; } else this.currentFontSize = this.fontSize[5]; let input = { value: "", fontSize: this.currentFontSize, color: this.f...
// }
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/app/module/unauthen-pages/un-authen-signing/signature-dialog/signature-dialog.component.ts#L613-L662
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
EditRoleDialogComponent.selectOrDeselectAllIndeterminateParents
selectOrDeselectAllIndeterminateParents(doSelect: boolean) { this.treeControl.dataNodes.forEach((parent) => { this.selectOrDeselectTheIndeterminateParent(parent, doSelect); }); }
// Cho những node có trạng thái indeterminate vào list.
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/app/roles/edit-role/edit-role-dialog.component.ts#L177-L181
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
AppUrlService.getAppRootUrlOfTenant
getAppRootUrlOfTenant(tenancyName?: string): string { let baseUrl = this.ensureEndsWith(AppConsts.appBaseUrl, '/'); if (baseUrl.indexOf(AppUrlService.tenancyNamePlaceHolder) < 0) { return baseUrl; } if (baseUrl.indexOf(AppUrlService.tenancyNamePlaceHolder + '.') >= 0) { ...
/** * Returning url ends with '/'. */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/nav/app-url.service.ts#L27-L46
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
AccountServiceProxy.isTenantAvailable
isTenantAvailable(body: IsTenantAvailableInput | undefined): Observable<IsTenantAvailableOutput> { let url_ = this.baseUrl + "/api/services/app/Account/IsTenantAvailable"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: c...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L34-L62
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
AccountServiceProxy.register
register(body: RegisterInput | undefined): Observable<RegisterOutput> { let url_ = this.baseUrl + "/api/services/app/Account/Register"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe: "respo...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L90-L118
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
ConfigurationServiceProxy.changeUiTheme
changeUiTheme(body: ChangeUiThemeInput | undefined): Observable<void> { let url_ = this.baseUrl + "/api/services/app/Configuration/ChangeUiTheme"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, obse...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L158-L185
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
RoleServiceProxy.create
create(body: CreateRoleDto | undefined): Observable<RoleDto> { let url_ = this.baseUrl + "/api/services/app/Role/Create"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe: "response", ...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L227-L255
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
RoleServiceProxy.getRoles
getRoles(permission: string | undefined): Observable<RoleListDtoListResultDto> { let url_ = this.baseUrl + "/api/services/app/Role/GetRoles?"; if (permission === null) throw new Error("The parameter 'permission' cannot be null."); else if (permission !== undefined) url_ +...
/** * @param permission (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L287-L315
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
RoleServiceProxy.update
update(body: RoleDto | undefined): Observable<RoleDto> { let url_ = this.baseUrl + "/api/services/app/Role/Update"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe: "response", re...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L343-L371
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
RoleServiceProxy.delete
delete(id: number | undefined): Observable<void> { let url_ = this.baseUrl + "/api/services/app/Role/Delete?"; if (id === null) throw new Error("The parameter 'id' cannot be null."); else if (id !== undefined) url_ += "Id=" + encodeURIComponent("" + id) + "&"; url...
/** * @param id (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L399-L426
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
RoleServiceProxy.getAllPermissions
getAllPermissions(): Observable<PermissionDtoListResultDto> { let url_ = this.baseUrl + "/api/services/app/Role/GetAllPermissions"; url_ = url_.replace(/[?&]$/, ""); let options_: any = { observe: "response", responseType: "blob", headers: new HttpHeaders({ ...
/** * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L450-L474
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
RoleServiceProxy.getRoleForEdit
getRoleForEdit(id: number | null | undefined) { return this.http.get(this.baseUrl + "/api/services/app/Role/GetRoleForEdit?Id=" + id); }
// }
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L531-L533
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
RoleServiceProxy.get
get(id: number | undefined): Observable<RoleDto> { let url_ = this.baseUrl + "/api/services/app/Role/Get?"; if (id === null) throw new Error("The parameter 'id' cannot be null."); else if (id !== undefined) url_ += "Id=" + encodeURIComponent("" + id) + "&"; url_ =...
/** * @param id (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L560-L588
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
RoleServiceProxy.getAll
getAll(keyword: string | undefined, skipCount: number | undefined, maxResultCount: number | undefined): Observable<RoleDtoPagedResultDto> { let url_ = this.baseUrl + "/api/services/app/Role/GetAll?"; if (keyword === null) throw new Error("The parameter 'keyword' cannot be null."); el...
/** * @param keyword (optional) * @param skipCount (optional) * @param maxResultCount (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L618-L654
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
SessionServiceProxy.getCurrentLoginInformations
getCurrentLoginInformations(): Observable<GetCurrentLoginInformationsOutput> { let url_ = this.baseUrl + "/api/services/app/Session/GetCurrentLoginInformations"; url_ = url_.replace(/[?&]$/, ""); let options_: any = { observe: "response", responseType: "blob", ...
/** * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L693-L717
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
TenantServiceProxy.create
create(body: CreateTenantDto | undefined): Observable<TenantDto> { let url_ = this.baseUrl + "/api/services/app/Tenant/Create"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe: "response", ...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L757-L785
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
TenantServiceProxy.delete
delete(id: number | undefined): Observable<void> { let url_ = this.baseUrl + "/api/services/app/Tenant/Delete?"; if (id === null) throw new Error("The parameter 'id' cannot be null."); else if (id !== undefined) url_ += "Id=" + encodeURIComponent("" + id) + "&"; u...
/** * @param id (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L813-L840
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
TenantServiceProxy.get
get(id: number | undefined): Observable<TenantDto> { let url_ = this.baseUrl + "/api/services/app/Tenant/Get?"; if (id === null) throw new Error("The parameter 'id' cannot be null."); else if (id !== undefined) url_ += "Id=" + encodeURIComponent("" + id) + "&"; ur...
/** * @param id (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L865-L893
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
TenantServiceProxy.getAll
getAll(keyword: string | undefined, isActive: boolean | undefined, skipCount: number | undefined, maxResultCount: number | undefined): Observable<TenantDtoPagedResultDto> { let url_ = this.baseUrl + "/api/services/app/Tenant/GetAll?"; if (keyword === null) throw new Error("The parameter 'key...
/** * @param keyword (optional) * @param isActive (optional) * @param skipCount (optional) * @param maxResultCount (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L924-L964
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
TenantServiceProxy.update
update(body: TenantDto | undefined): Observable<TenantDto> { let url_ = this.baseUrl + "/api/services/app/Tenant/Update"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe: "response", ...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L992-L1020
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
TokenAuthServiceProxy.authenticate
authenticate(body: AuthenticateModel | undefined): Observable<AuthenticateResultModel> { let url_ = this.baseUrl + "/api/TokenAuth/Authenticate"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, obser...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1060-L1088
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
TokenAuthServiceProxy.getExternalAuthenticationProviders
getExternalAuthenticationProviders(): Observable<ExternalLoginProviderInfoModel[]> { let url_ = this.baseUrl + "/api/TokenAuth/GetExternalAuthenticationProviders"; url_ = url_.replace(/[?&]$/, ""); let options_: any = { observe: "response", responseType: "blob", ...
/** * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1115-L1139
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
TokenAuthServiceProxy.externalAuthenticate
externalAuthenticate(body: ExternalAuthenticateModel | undefined): Observable<ExternalAuthenticateResultModel> { let url_ = this.baseUrl + "/api/TokenAuth/ExternalAuthenticate"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { b...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1174-L1202
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
UserServiceProxy.create
create(body: CreateUserDto | undefined): Observable<UserDto> { let url_ = this.baseUrl + "/api/services/app/User/Create"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe: "response", ...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1242-L1270
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
UserServiceProxy.update
update(body: UserDto | undefined): Observable<UserDto> { let url_ = this.baseUrl + "/api/services/app/User/Update"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe: "response", re...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1298-L1326
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
UserServiceProxy.delete
delete(id: number | undefined): Observable<void> { let url_ = this.baseUrl + "/api/services/app/User/Delete?"; if (id === null) throw new Error("The parameter 'id' cannot be null."); else if (id !== undefined) url_ += "Id=" + encodeURIComponent("" + id) + "&"; url...
/** * @param id (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1354-L1381
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
UserServiceProxy.activate
activate(body: Int64EntityDto | undefined): Observable<void> { let url_ = this.baseUrl + "/api/services/app/User/Activate"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe: "response", ...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1406-L1433
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
UserServiceProxy.deActivate
deActivate(body: Int64EntityDto | undefined): Observable<void> { let url_ = this.baseUrl + "/api/services/app/User/DeActivate"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe: "response", ...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1458-L1485
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
UserServiceProxy.getRoles
getRoles(): Observable<RoleDtoListResultDto> { let url_ = this.baseUrl + "/api/services/app/User/GetRoles"; url_ = url_.replace(/[?&]$/, ""); let options_: any = { observe: "response", responseType: "blob", headers: new HttpHeaders({ "Accept":...
/** * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1509-L1533
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
UserServiceProxy.changeLanguage
changeLanguage(body: ChangeUserLanguageDto | undefined): Observable<void> { let url_ = this.baseUrl + "/api/services/app/User/ChangeLanguage"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe:...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1561-L1588
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
UserServiceProxy.changePassword
changePassword(body: ChangePasswordDto | undefined): Observable<boolean> { let url_ = this.baseUrl + "/api/services/app/User/ChangePassword"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe: ...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1613-L1641
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
UserServiceProxy.resetPassword
resetPassword(body: ResetPasswordDto | undefined): Observable<boolean> { let url_ = this.baseUrl + "/api/services/app/User/ResetPassword"; url_ = url_.replace(/[?&]$/, ""); const content_ = JSON.stringify(body); let options_: any = { body: content_, observe: "re...
/** * @param body (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1669-L1697
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
UserServiceProxy.get
get(id: number | undefined): Observable<UserDto> { let url_ = this.baseUrl + "/api/services/app/User/Get?"; if (id === null) throw new Error("The parameter 'id' cannot be null."); else if (id !== undefined) url_ += "Id=" + encodeURIComponent("" + id) + "&"; url_ =...
/** * @param id (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1725-L1753
67dea9bf086e0e39ba7d83491c1126152e8dfaad
metasign
github_2023
ncc-erp
typescript
UserServiceProxy.getAll
getAll(keyword: string | undefined, isActive: boolean | undefined, skipCount: number | undefined, maxResultCount: number | undefined): Observable<UserDtoPagedResultDto> { let url_ = this.baseUrl + "/api/services/app/User/GetAll?"; if (keyword === null) throw new Error("The parameter 'keyword...
/** * @param keyword (optional) * @param isActive (optional) * @param skipCount (optional) * @param maxResultCount (optional) * @return Success */
https://github.com/ncc-erp/metasign/blob/67dea9bf086e0e39ba7d83491c1126152e8dfaad/angular/src/shared/service-proxies/service-proxies.ts#L1784-L1824
67dea9bf086e0e39ba7d83491c1126152e8dfaad
FormBuilder
github_2023
KryptXBSA
typescript
shouldHandleEvent
function shouldHandleEvent(element: HTMLElement | null) { let cur = element; while (cur) { if (cur.dataset?.noDnd) { return false; } cur = cur.parentElement; } return true; }
// export class KeyboardSensor extends LibKeyboardSensor {
https://github.com/KryptXBSA/FormBuilder/blob/d0a194b1d0dc4ab7074e94f677655ea9b66c32dd/apps/web/src/app/builder/_components/CustomSensor.ts#L29-L40
d0a194b1d0dc4ab7074e94f677655ea9b66c32dd
FormBuilder
github_2023
KryptXBSA
typescript
handleSelect
const handleSelect = (newDay: Date | undefined) => { if (!newDay) { return; } if (!defaultPopupValue) { newDay.setHours( month?.getHours() ?? 0, month?.getMinutes() ?? 0, month?.getSeconds() ?? 0, ); onChange?.(newDay); setMonth(newDay); return; } const diff = newDa...
/** * carry over the current time when a user clicks a new day * instead of resetting to 00:00 */
https://github.com/KryptXBSA/FormBuilder/blob/d0a194b1d0dc4ab7074e94f677655ea9b66c32dd/apps/web/src/components/ui/datetime-picker.tsx#L757-L783
d0a194b1d0dc4ab7074e94f677655ea9b66c32dd
cli
github_2023
code-pushup
typescript
AppComponent.getWelcomeMessage
getWelcomeMessage() { return 'Welcome to My Angular App!'; }
/** * Dummy method that returns a welcome message * @returns {string} - The welcome message */
https://github.com/code-pushup/cli/blob/6c0097f518524481663ed2d2029ad6a8ea8d42c2/e2e/plugin-jsdocs-e2e/mocks/fixtures/angular/src/app.component.ts#L11-L13
6c0097f518524481663ed2d2029ad6a8ea8d42c2
cli
github_2023
code-pushup
typescript
safeEnum
function safeEnum< T extends | PortalCategoryRefType | PortalIssueSeverity | PortalIssueSourceType | PortalTableAlignment, >(value: `${T}`): T { return value as T; }
// validates enum value string, workaround for nominal typing
https://github.com/code-pushup/cli/blob/6c0097f518524481663ed2d2029ad6a8ea8d42c2/packages/core/src/lib/implementation/report-to-gql.ts#L186-L194
6c0097f518524481663ed2d2029ad6a8ea8d42c2
cli
github_2023
code-pushup
typescript
duplicateSlugsInAuditsErrorMsg
function duplicateSlugsInAuditsErrorMsg(audits: AuditOutput[]) { const duplicateRefs = getDuplicateSlugsInAudits(audits); return `In plugin audits the slugs are not unique: ${errorItems( duplicateRefs, )}`; }
// helper for validator: audit slugs are unique
https://github.com/code-pushup/cli/blob/6c0097f518524481663ed2d2029ad6a8ea8d42c2/packages/models/src/lib/audit-output.ts#L54-L59
6c0097f518524481663ed2d2029ad6a8ea8d42c2
cli
github_2023
code-pushup
typescript
duplicateSlugsInAuditsErrorMsg
function duplicateSlugsInAuditsErrorMsg(audits: Audit[]) { const duplicateRefs = getDuplicateSlugsInAudits(audits); return `In plugin audits the following slugs are not unique: ${errorItems( duplicateRefs, )}`; }
// =======================
https://github.com/code-pushup/cli/blob/6c0097f518524481663ed2d2029ad6a8ea8d42c2/packages/models/src/lib/audit.ts#L36-L41
6c0097f518524481663ed2d2029ad6a8ea8d42c2
cli
github_2023
code-pushup
typescript
duplicateSlugCategoriesErrorMsg
function duplicateSlugCategoriesErrorMsg(categories: CategoryConfig[]) { const duplicateStringSlugs = getDuplicateSlugCategories(categories); return `In the categories, the following slugs are duplicated: ${errorItems( duplicateStringSlugs, )}`; }
// helper for validator: categories slugs are unique
https://github.com/code-pushup/cli/blob/6c0097f518524481663ed2d2029ad6a8ea8d42c2/packages/models/src/lib/category-config.ts#L79-L84
6c0097f518524481663ed2d2029ad6a8ea8d42c2