Skip to content

Commit

Permalink
Published freedombase:[email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
StorytellerCZ committed May 13, 2023
1 parent adcef0b commit 2e45118
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .versions
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ [email protected]
[email protected]
[email protected]
[email protected]
freedombase:[email protected]-rc.1
freedombase:[email protected]
[email protected]
[email protected]
[email protected]
local-test:freedombase:[email protected]-rc.1
local-test:freedombase:[email protected]
[email protected]
[email protected]
[email protected]
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,19 +190,19 @@ This hook will receive in the first argument which agreement is the subject of t
#### `afterAgreedHook`
Import: `import { afterAgreedHook } from 'meteor/freedombase:legal-management`
Part of the `freedombase:legal.agreements.agreeBy` method and triggers after DB actions take place.
You can create a new hook by registering it: `afterAgreedHook.register((afterAgreedHook, userId, dbResults) => {})`
You can create a new hook by registering it: `afterAgreedHook.register((whichAgreement, userId, dbResults) => {})`
This hook will receive in the first argument which agreement is the subject of the call and in second the user id, the final one will be the result of the DB action.

#### `beforeRevokedHook`
Import: `import { beforeRevokedHook } from 'meteor/freedombase:legal-management`
Part of the `freedombase:legal.agreements.revokeBy` method and triggers before any DB action takes place.
You can create a new hook by registering it: `beforeRevokedHook.register((afterAgreedHook, userId) => {})`
You can create a new hook by registering it: `beforeRevokedHook.register((whichAgreement, userId) => {})`
This hook will receive in the first argument which agreement is the subject of the call and in second the user id.

#### `afterRevokedHook`
Import: `import { afterRevokedHook } from 'meteor/freedombase:legal-management`
Part of the `freedombase:legal.agreements.revokeBy` method and triggers after DB actions take place.
You can create a new hook by registering it: `afterRevokedHook.register((afterAgreedHook, userId, dbResults) => {})`
You can create a new hook by registering it: `afterRevokedHook.register((whichAgreement, userId, dbResults) => {})`
This hook will receive in the first argument which agreement is the subject of the call and in second the user id, the final one will be the result of the DB action.

### Publications
Expand Down
4 changes: 2 additions & 2 deletions common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './common/agreement'
import './common/legal'

export { LegalAgreementCollection, LegalAgreement } from './common/agreement'
export { LegalCollection, LegalDocument } from './common/legal'
export { LegalAgreementCollection } from './common/agreement'
export { LegalCollection } from './common/legal'
41 changes: 38 additions & 3 deletions legal.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export declare type LegalRichText = {
import { Mongo } from 'meteor/mongo'

type LegalRichText = {
content?: object,
html?: string
}
Expand All @@ -17,13 +19,13 @@ export declare type LegalDocument = {
updatedAt?: Date
}

export declare type Agreements = {
declare type Agreements = {
documentAbbr?: string,
documentId: string,
agreed: boolean
}

export declare type History = {
declare type History = {
createdAt: Date,
agreement: string,
action: 'revoked' | 'agreed' | 'revision'
Expand All @@ -37,3 +39,36 @@ export declare type LegalAgreement = {
createdAt: Date,
updatedAt?: Date
}

export var LegalCollection: Mongo.Collection<LegalDocument>
export var LegalAgreementCollection: Mongo.Collection<LegalAgreement>

interface CanAddLegalHook {
register: (documentAbbr: string, language: string, userId: string) => boolean
}

export var canAddLegalHook: CanAddLegalHook

interface BeforeAgreedHook {
register: (whichAgreement: string, userId: string) => boolean
}

export var beforeAgreedHook: BeforeAgreedHook

interface AfterAgreedHook {
register: (whichAgreement: string, userId: string, dbResults: number | string) => void
}

export var afterAgreedHook: AfterAgreedHook

interface BeforeRevokedHook {
register: (whichAgreement: string, userId: string) => void
}

export var beforeRevokedHook: BeforeRevokedHook

interface AfterRevokedHook {
register: (whichAgreement: string, userId: string, dbResults: number | string) => void
}

export var afterRevokedHook: AfterRevokedHook
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global Package */
Package.describe({
name: 'freedombase:legal-management',
version: '1.8.0-rc.1',
version: '1.8.0',
summary: 'Manage your legal documents and user consent.',
git: 'https://github.com/freedombase/meteor-legal-management',
documentation: 'README.md'
Expand Down

0 comments on commit 2e45118

Please sign in to comment.