Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
agenda.push(function createNewPadDataFile () {
store.add(newInstance, ns.rdf('type'), PAD('Notepad'), newPadDoc)
// TODO @@ Remove casting of add
;(store.add as any)(
newInstance,
ns.dc('created'),
new Date(),
newPadDoc
)
if (me) {
store.add(newInstance, ns.dc('author'), me, newPadDoc)
}
store.add(newInstance, PAD('next'), newInstance, newPadDoc) // linked list empty
// Keep a paper trail @@ Revisit when we have non-public ones @@ Privacy
store.add(newInstance, ns.space('inspiration'), thisInstance, padDoc)
store.add(newInstance, ns.space('inspiration'), thisInstance, newPadDoc)
updater.put(
newPadDoc,
store.statementsMatching(undefined, undefined, undefined, newPadDoc),
'text/turtle',
const store = context.session.store
const updater = store.updater as UpdateManager
if (newPaneOptions.me && !newPaneOptions.me.uri) {
throw new Error('notepad mintNew: Invalid userid')
}
var newInstance = (newPaneOptions.newInstance =
newPaneOptions.newInstance ||
store.sym(newPaneOptions.newBase + 'index.ttl#this'))
// var newInstance = kb.sym(newBase + 'pad.ttl#thisPad');
var newPadDoc = newInstance.doc()
store.add(newInstance, ns.rdf('type'), ns.pad('Notepad'), newPadDoc)
// @@ TODO Remove casting
;(store.add as any)(newInstance, ns.dc('title'), 'Shared Notes', newPadDoc)
;(store.add as any)(newInstance, ns.dc('created'), new Date(), newPadDoc)
if (newPaneOptions.me) {
store.add(newInstance, ns.dc('author'), newPaneOptions.me, newPadDoc)
}
// kb.add(newInstance, ns.pad('next'), newInstance, newPadDoc);
// linked list empty @@
var chunk = store.sym(newInstance.uri + '_line0')
store.add(newInstance, ns.pad('next'), chunk, newPadDoc) // Linked list has one entry
store.add(chunk, ns.pad('next'), newInstance, newPadDoc)
store.add(chunk, ns.dc('author'), newPaneOptions.me, newPadDoc)
// @@ TODO Remove casting
;(store.add as any)(chunk, ns.sioc('content'), '', newPadDoc)
return new Promise(function (resolve, reject) {
updater.put(
newPadDoc,
store.statementsMatching(undefined, undefined, undefined, newPadDoc),
agenda.push(function createNewPadDataFile () {
store.add(newInstance, ns.rdf('type'), PAD('Notepad'), newPadDoc)
// TODO @@ Remove casting of add
;(store.add as any)(
newInstance,
ns.dc('created'),
new Date(),
newPadDoc
)
if (me) {
store.add(newInstance, ns.dc('author'), me, newPadDoc)
}
store.add(newInstance, PAD('next'), newInstance, newPadDoc) // linked list empty
// Keep a paper trail @@ Revisit when we have non-public ones @@ Privacy
store.add(newInstance, ns.space('inspiration'), thisInstance, padDoc)
store.add(newInstance, ns.space('inspiration'), thisInstance, newPadDoc)
updater.put(
newPadDoc,
store.statementsMatching(undefined, undefined, undefined, newPadDoc),
'text/turtle',
function (_uri2: string, ok: boolean, message: string) {
if (ok) {
agenda.shift()!()
} else {
complainIfBad(
mintNew: function (context, newPaneOptions: any) {
const store = context.session.store
const updater = store.updater as UpdateManager
if (newPaneOptions.me && !newPaneOptions.me.uri) {
throw new Error('notepad mintNew: Invalid userid')
}
var newInstance = (newPaneOptions.newInstance =
newPaneOptions.newInstance ||
store.sym(newPaneOptions.newBase + 'index.ttl#this'))
// var newInstance = kb.sym(newBase + 'pad.ttl#thisPad');
var newPadDoc = newInstance.doc()
store.add(newInstance, ns.rdf('type'), ns.pad('Notepad'), newPadDoc)
// @@ TODO Remove casting
;(store.add as any)(newInstance, ns.dc('title'), 'Shared Notes', newPadDoc)
;(store.add as any)(newInstance, ns.dc('created'), new Date(), newPadDoc)
if (newPaneOptions.me) {
store.add(newInstance, ns.dc('author'), newPaneOptions.me, newPadDoc)
}
// kb.add(newInstance, ns.pad('next'), newInstance, newPadDoc);
// linked list empty @@
var chunk = store.sym(newInstance.uri + '_line0')
store.add(newInstance, ns.pad('next'), chunk, newPadDoc) // Linked list has one entry
store.add(chunk, ns.pad('next'), newInstance, newPadDoc)
store.add(chunk, ns.dc('author'), newPaneOptions.me, newPadDoc)
// @@ TODO Remove casting
;(store.add as any)(chunk, ns.sioc('content'), '', newPadDoc)
return new Promise(function (resolve, reject) {
updater.put(
newPadDoc,
const store = context.session.store
const updater = store.updater as UpdateManager
if (newPaneOptions.me && !newPaneOptions.me.uri) {
throw new Error('notepad mintNew: Invalid userid')
}
var newInstance = (newPaneOptions.newInstance =
newPaneOptions.newInstance ||
store.sym(newPaneOptions.newBase + 'index.ttl#this'))
// var newInstance = kb.sym(newBase + 'pad.ttl#thisPad');
var newPadDoc = newInstance.doc()
store.add(newInstance, ns.rdf('type'), ns.pad('Notepad'), newPadDoc)
// @@ TODO Remove casting
;(store.add as any)(newInstance, ns.dc('title'), 'Shared Notes', newPadDoc)
;(store.add as any)(newInstance, ns.dc('created'), new Date(), newPadDoc)
if (newPaneOptions.me) {
store.add(newInstance, ns.dc('author'), newPaneOptions.me, newPadDoc)
}
// kb.add(newInstance, ns.pad('next'), newInstance, newPadDoc);
// linked list empty @@
var chunk = store.sym(newInstance.uri + '_line0')
store.add(newInstance, ns.pad('next'), chunk, newPadDoc) // Linked list has one entry
store.add(chunk, ns.pad('next'), newInstance, newPadDoc)
store.add(chunk, ns.dc('author'), newPaneOptions.me, newPadDoc)
// @@ TODO Remove casting
;(store.add as any)(chunk, ns.sioc('content'), '', newPadDoc)
return new Promise(function (resolve, reject) {
updater.put(
newPadDoc,
store.statementsMatching(undefined, undefined, undefined, newPadDoc),
agenda.push(function createNewPadDataFile () {
store.add(newInstance, ns.rdf('type'), PAD('Notepad'), newPadDoc)
// TODO @@ Remove casting of add
;(store.add as any)(
newInstance,
ns.dc('created'),
new Date(),
newPadDoc
)
if (me) {
store.add(newInstance, ns.dc('author'), me, newPadDoc)
}
store.add(newInstance, PAD('next'), newInstance, newPadDoc) // linked list empty
// Keep a paper trail @@ Revisit when we have non-public ones @@ Privacy
store.add(newInstance, ns.space('inspiration'), thisInstance, padDoc)
store.add(newInstance, ns.space('inspiration'), thisInstance, newPadDoc)
updater.put(
newPadDoc,
store.statementsMatching(undefined, undefined, undefined, newPadDoc),
'text/turtle',
function (_uri2: string, ok: boolean, message: string) {
if (ok) {
agenda.shift()!()
} else {
complainIfBad(
if (newPaneOptions.me && !newPaneOptions.me.uri) {
throw new Error('notepad mintNew: Invalid userid')
}
var newInstance = (newPaneOptions.newInstance =
newPaneOptions.newInstance ||
store.sym(newPaneOptions.newBase + 'index.ttl#this'))
// var newInstance = kb.sym(newBase + 'pad.ttl#thisPad');
var newPadDoc = newInstance.doc()
store.add(newInstance, ns.rdf('type'), ns.pad('Notepad'), newPadDoc)
// @@ TODO Remove casting
;(store.add as any)(newInstance, ns.dc('title'), 'Shared Notes', newPadDoc)
;(store.add as any)(newInstance, ns.dc('created'), new Date(), newPadDoc)
if (newPaneOptions.me) {
store.add(newInstance, ns.dc('author'), newPaneOptions.me, newPadDoc)
}
// kb.add(newInstance, ns.pad('next'), newInstance, newPadDoc);
// linked list empty @@
var chunk = store.sym(newInstance.uri + '_line0')
store.add(newInstance, ns.pad('next'), chunk, newPadDoc) // Linked list has one entry
store.add(chunk, ns.pad('next'), newInstance, newPadDoc)
store.add(chunk, ns.dc('author'), newPaneOptions.me, newPadDoc)
// @@ TODO Remove casting
;(store.add as any)(chunk, ns.sioc('content'), '', newPadDoc)
return new Promise(function (resolve, reject) {
updater.put(
newPadDoc,
store.statementsMatching(undefined, undefined, undefined, newPadDoc),
'text/turtle',
function (uri2: string, ok: boolean, message: string) {
agenda.push(function createNewPadDataFile () {
store.add(newInstance, ns.rdf('type'), PAD('Notepad'), newPadDoc)
// TODO @@ Remove casting of add
;(store.add as any)(
newInstance,
ns.dc('created'),
new Date(),
newPadDoc
)
if (me) {
store.add(newInstance, ns.dc('author'), me, newPadDoc)
}
store.add(newInstance, PAD('next'), newInstance, newPadDoc) // linked list empty
// Keep a paper trail @@ Revisit when we have non-public ones @@ Privacy
store.add(newInstance, ns.space('inspiration'), thisInstance, padDoc)
store.add(newInstance, ns.space('inspiration'), thisInstance, newPadDoc)
updater.put(
newPadDoc,
store.statementsMatching(undefined, undefined, undefined, newPadDoc),
'text/turtle',