@data-fair/lib-common-types 1.20.4 → 1.20.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.
- package/access-ref/index.js +1 -0
- package/access-ref/index.js.map +1 -0
- package/access-ref/schema.js +1 -0
- package/access-ref/schema.js.map +1 -0
- package/account/index.js +1 -0
- package/account/index.js.map +1 -0
- package/account/schema.js +1 -0
- package/account/schema.js.map +1 -0
- package/application/index.js +1 -0
- package/application/index.js.map +1 -0
- package/application/schema.js +1 -0
- package/application/schema.js.map +1 -0
- package/catalog/index.js +1 -0
- package/catalog/index.js.map +1 -0
- package/catalog/schema.js +1 -0
- package/catalog/schema.js.map +1 -0
- package/event/index.js +1 -0
- package/event/index.js.map +1 -0
- package/event/schema.js +1 -0
- package/event/schema.js.map +1 -0
- package/notification/index.js +1 -0
- package/notification/index.js.map +1 -0
- package/notification/schema.js +1 -0
- package/notification/schema.js.map +1 -0
- package/package.json +1 -1
- package/processings.js +1 -0
- package/processings.js.map +1 -0
- package/session/index.js +1 -0
- package/session/index.js.map +1 -0
- package/session/schema.js +1 -0
- package/session/schema.js.map +1 -0
- package/theme/.type/index.d.ts +6 -6
- package/theme/index.d.ts +31 -30
- package/theme/index.js +153 -85
- package/theme/index.js.map +1 -0
- package/theme/schema.d.ts +9 -9
- package/theme/schema.js +62 -61
- package/theme/schema.js.map +1 -0
- package/ws.js +1 -0
- package/ws.js.map +1 -0
package/access-ref/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAGA,cAAc,kBAAkB,CAAA;AAEhC;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAkC,EAAE,SAAoB,EAAW,EAAE;IAClG,oCAAoC;IACpC,IAAI,SAAS,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC9B,IAAI,IAAI,IAAI,SAAS;YAAE,OAAO,O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E,OAAO,UAAU,CAAA;IAEtD,MAAM,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU;QACpD,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,mBAAmB,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,EAAE;QAC7H,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,mBAAmB,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,mBAAmB,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,CAAA;IAExG,MAAM,aAAa,GAAwB;QACzC,IAAI,EAAE;YACJ,EAAE,aAAa,EAAE,cAAc,EAAE;YACjC,EAAE,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE;YACnC,EAAE,GAAG,EAAE,CAAC,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,EAAE;YACvI,mBAAmB;SACpB;KACF,CAAA;IAED,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IAClC,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA","sourcesContent":["import { type AccessRef } from './.type/index.js'\nimport { type SessionStateAuthenticated } from '../session/index.js'\n\nexport * from './.type/index.js'\n\n/**\n * Check if the current session matches an access ref.\n */\nexport const matchAccessRef = (session: SessionStateAuthenticated, accessRef: AccessRef): boolean => {\n // Check by user, not active account\n if (accessRef.type === 'user') {\n if ('id' in accessRef) return session.user.id === accessRef.id\n if ('email' in accessRef) return session.user.email === accessRef.email\n return false\n }\n\n // Check by active account\n if (accessRef.type === 'organization') {\n if (session.account.type !== 'organization') return false\n if (session.account.id !== accessRef.id) return false\n\n // Check department: '*' matches all, specific dept must match\n if (\n accessRef.department &&\n accessRef.department !== '*' &&\n session.account.department !== accessRef.department\n ) return false\n\n // Check roles: empty array matches all, non-empty must include current role\n if (\n accessRef.roles &&\n accessRef.roles.length > 0 &&\n !accessRef.roles.includes(session.accountRole)\n ) return false\n\n return true\n }\n\n return false\n}\n\n/**\n * Returns conditions to spread into a MongoDB $elemMatch for permissions array.\n *\n * @example\n * { permissions: { $elemMatch: { ...mongoFilterAccessRef(session), operation: 'read' } } }\n */\nexport const mongoFilterAccessRef = (session: SessionStateAuthenticated): Record<string, any> => {\n const userFilter: Record<'$or', Record<string, any>[]> = {\n $or: [\n { 'access.type': 'user', 'access.id': session.user.id },\n { 'access.type': 'user', 'access.email': session.user.email }\n ]\n }\n\n if (session.account.type === 'user') return userFilter\n\n const departmentCondition = session.account.department\n ? { $or: [{ 'access.department': { $exists: false } }, { 'access.department': { $in: ['*', session.account.department] } }] }\n : { $or: [{ 'access.department': { $exists: false } }, { 'access.department': { $in: ['-', '*'] } }] }\n\n const baseOrgFilter: Record<string, any> = {\n $and: [\n { 'access.type': 'organization' },\n { 'access.id': session.account.id },\n { $or: [{ 'access.roles': { $exists: false } }, { 'access.roles': { $size: 0 } }, { 'access.roles': { $in: [session.accountRole] } }] },\n departmentCondition\n ]\n }\n\n userFilter.$or.push(baseOrgFilter)\n return userFilter\n}\n"]}
|
package/access-ref/schema.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,eAAe;IACb,GAAG,EAAE,6CAA6C;IAClD,WAAW,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;IAClC,KAAK,EAAE,YAAY;IACnB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QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE;gBAC/C,EAAE,EAAE;oBACF,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE;wBACN,IAAI,EAAE,MAAM;wBACZ,YAAY,EAAE,kBAAkB;qBACjC;iBACF;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,aAAa;oBACpB,cAAc,EAAE;wBACd,EAAE,EAAE,aAAa;wBACjB,EAAE,EAAE,YAAY;wBAChB,EAAE,EAAE,cAAc;wBAClB,EAAE,EAAE,cAAc;wBAClB,EAAE,EAAE,cAAc;wBAClB,EAAE,EAAE,WAAW;qBAChB;oBACD,MAAM,EAAE;wBACN,QAAQ,EAAE;4BACR,GAAG,EAAE,yDAAyD;4BAC9D,YAAY,EAAE,kIAAkI;4BAChJ,SAAS,EAAE,WAAW;4BACtB,SAAS,EAAE,SAAS;yBACrB;qBACF;iBACF;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,OAAO;oBACd,cAAc,EAAE;wBACd,EAAE,EAAE,OAAO;wBACX,EAAE,EAAE,OAAO;wBACX,EAAE,EAAE,OAAO;wBACX,EAAE,EAAE,OAAO;wBACX,EAAE,EAAE,SAAS;wBACb,EAAE,EAAE,QAAQ;qBACb;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;qBACf;oBACD,MAAM,EAAE;wBACN,QAAQ,EAAE;4BACR,GAAG,EAAE,yDAAyD;4BAC9D,YAAY,EAAE,YAAY;yBAC3B;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAA","sourcesContent":["/* eslint-disable no-template-curly-in-string */\nexport default {\n $id: 'https://github.com/data-fair/lib/access-ref',\n 'x-exports': ['types', 'validate'],\n title: 'Access Ref',\n 'x-i18n-title': {\n fr: 'Référence d\\'accès',\n en: 'Access Ref',\n es: 'Referencia de acceso',\n it: 'Riferimento di accesso',\n pt: 'Referência de acesso',\n de: 'Zugriffsreferenz'\n },\n type: 'object',\n discriminator: {\n propertyName: 'mode'\n },\n oneOfLayout: {\n emptyData: true\n },\n oneOf: [\n {\n title: \"Un membre de l'organisation\",\n 'x-i18n-title': {\n fr: \"Un membre de l'organisation\",\n en: 'An organization member',\n es: 'Un miembro de la organización',\n it: \"Un membro dell'organizzazione\",\n pt: 'Um membro da organização',\n de: 'Ein Organisationsmitglied'\n },\n layout: { if: \"context.owner.type === 'organization'\" },\n required: ['mode', 'type', 'id'],\n additionalProperties: false,\n properties: {\n mode: { type: 'string', const: 'member' },\n type: { type: 'string', const: 'user' },\n id: {\n type: 'string',\n title: 'Membre',\n 'x-i18n-title': {\n fr: 'Membre',\n en: 'Member',\n es: 'Miembro',\n it: 'Membro',\n pt: 'Membro',\n de: 'Mitglied'\n },\n layout: {\n getItems: {\n url: '/simple-directory/api/organizations/${context.owner.id}/members',\n itemsResults: 'data.results',\n itemTitle: 'item.name',\n itemValue: 'item.id',\n itemIcon: '`/simple-directory/api/avatars/user/${item.id}/avatar.png`'\n }\n }\n }\n }\n },\n {\n title: 'Un email',\n 'x-i18n-title': {\n fr: 'Un email',\n en: 'An email',\n es: 'Un correo electrónico',\n it: \"Un'email\",\n pt: 'Um email',\n de: 'Eine E-Mail'\n },\n required: ['mode', 'type', 'email'],\n additionalProperties: false,\n properties: {\n mode: { type: 'string', const: 'member' },\n type: { type: 'string', const: 'user' },\n email: {\n type: 'string',\n format: 'email',\n title: 'Adresse mail',\n 'x-i18n-title': {\n fr: 'Adresse mail',\n en: 'Email address',\n es: 'Dirección de correo',\n it: 'Indirizzo email',\n pt: 'Endereço de email',\n de: 'E-Mail-Adresse'\n }\n }\n }\n },\n {\n title: 'Une organisation partenaire',\n 'x-i18n-title': {\n fr: 'Une organisation partenaire',\n en: 'A partner organization',\n es: 'Una organización asociada',\n it: \"Un'organizzazione partner\",\n pt: 'Uma organização parceira',\n de: 'Eine Partnerorganisation'\n },\n layout: { if: \"context.owner.type === 'organization'\" },\n required: ['mode', 'type', 'id'],\n additionalProperties: false,\n properties: {\n mode: { type: 'string', const: 'member' },\n type: { type: 'string', const: 'organization' },\n department: { type: 'string', const: '*' },\n roles: { type: 'array', const: [], items: { type: 'string' } },\n id: {\n type: 'string',\n title: 'Partenaire',\n 'x-i18n-title': {\n fr: 'Partenaire',\n en: 'Partner',\n es: 'Socio',\n it: 'Partner',\n pt: 'Parceiro',\n de: 'Partner'\n },\n layout: {\n getItems: {\n url: '/simple-directory/api/organizations/${context.owner.id}',\n itemsResults: 'data.partners',\n itemTitle: 'item.name',\n itemValue: 'item.id',\n itemIcon: '`/simple-directory/api/avatars/organization/${item.id}/avatar.png`'\n }\n }\n }\n }\n },\n {\n title: 'Un role ou département de mon organisation',\n 'x-i18n-title': {\n fr: 'Un rôle ou département de mon organisation',\n en: 'A role or department of my organization',\n es: 'Un rol o departamento de mi organización',\n it: 'Un ruolo o dipartimento della mia organizzazione',\n pt: 'Um papel ou departamento da minha organização',\n de: 'Eine Rolle oder Abteilung meiner Organisation'\n },\n layout: { if: \"context.owner.type === 'organization'\" },\n required: ['mode', 'type', 'id'],\n additionalProperties: false,\n properties: {\n mode: { type: 'string', const: 'internal' },\n type: { type: 'string', const: 'organization' },\n id: {\n type: 'string',\n layout: {\n comp: 'none',\n getConstData: 'context.owner.id'\n }\n },\n department: {\n type: 'string',\n title: 'Département',\n 'x-i18n-title': {\n fr: 'Département',\n en: 'Department',\n es: 'Departamento',\n it: 'Dipartimento',\n pt: 'Departamento',\n de: 'Abteilung'\n },\n layout: {\n getItems: {\n url: '/simple-directory/api/organizations/${context.owner.id}',\n itemsResults: '[...(data.departments || []), {id: \"*\", name: \"Tous les départements\"}, {id: \"-\", name: \"Racine de l\\'organisation uniquement\"}]',\n itemTitle: 'item.name',\n itemValue: 'item.id'\n }\n }\n },\n roles: {\n type: 'array',\n title: 'Rôles',\n 'x-i18n-title': {\n fr: 'Rôles',\n en: 'Roles',\n es: 'Roles',\n it: 'Ruoli',\n pt: 'Funções',\n de: 'Rollen'\n },\n items: {\n type: 'string'\n },\n layout: {\n getItems: {\n url: '/simple-directory/api/organizations/${context.owner.id}',\n itemsResults: 'data.roles'\n }\n }\n }\n }\n }\n ]\n}\n"]}
|
package/account/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA","sourcesContent":["export * from './.type/index.js'\n"]}
|
package/account/schema.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,eAAe;IACb,GAAG,EAAE,0CAA0C;IAC/C,WAAW,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;IAClC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC;IAChC,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;SAC/B;QACD,EAAE,EAAE;YACF,IAAI,EAAE,QAAQ;SACf;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;SACf;QACD,cAAc,EAAE;YACd,IAAI,EAAE,QAAQ;SACf;KACF;IACD,KAAK,EAAE;QACL,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,cAAc;YACrB,QAAQ,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC;YACxB,oBAAoB,EAAE,KAAK;YAC3B,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;iBAC/B;gBACD,EAAE,EAAE;oBACF,IAAI,EAAE,QAAQ;iBACf;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;CACF,CAAA","sourcesContent":["// TODO: remove this, duplicate of session/schema.ts\n\nexport default {\n $id: 'https://github.com/data-fair/lib/account',\n 'x-exports': ['types', 'validate'],\n type: 'object',\n title: 'account',\n required: ['type', 'id', 'name'],\n properties: {\n type: {\n type: 'string',\n enum: ['user', 'organization']\n },\n id: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n department: {\n type: 'string'\n },\n departmentName: {\n type: 'string'\n }\n },\n $defs: {\n accountKeys: {\n type: 'object',\n title: 'account keys',\n required: ['type', 'id'],\n additionalProperties: false,\n properties: {\n type: {\n type: 'string',\n enum: ['user', 'organization']\n },\n id: {\n type: 'string'\n },\n department: {\n type: 'string'\n }\n }\n }\n }\n}\n"]}
|
package/application/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA","sourcesContent":["export * from './.type/index.js'\n"]}
|
package/application/schema.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,GAAG,EAAE,8CAA8C;IACnD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,CAAC,OAAO,CAAC;IACtB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR,IAAI;QACJ,OAAO;QACP,YAAY;QACZ,MAAM;QACN,OAAO;QACP,OAAO;QACP,eAAe;KAChB;IACD,UAAU,EAAE;QACV,EAAE,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,+CAA+C;SAC7D;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,gCAAgC;SAC9C;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2CA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E;oBACN,IAAI,EAAE,QAAQ;iBACf;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,gBAAgB,EAAE;oBAChB,IAAI,EAAE,QAAQ;iBACf;gBACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC7B,YAAY,EAAE;oBACZ,UAAU,EAAE,IAAI;oBAChB,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;iBACzB;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACtB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;wBACzB,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;qBAC7B;iBACF;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,oBAAoB,EAAE;wBACpB,IAAI,EAAE,QAAQ;qBACf;iBACF;gBACD,oBAAoB,EAAE;oBACpB,IAAI,EAAE,SAAS;iBAChB;aACF;SACF;KACF;CACF,CAAA","sourcesContent":["export default {\n $id: 'https://github.com/data-fair/lib/application',\n title: 'Application',\n 'x-exports': ['types'],\n type: 'object',\n required: [\n 'id',\n 'title',\n 'exposedUrl',\n 'href',\n 'wsUrl',\n 'owner',\n 'configuration'\n ],\n properties: {\n id: {\n type: 'string',\n description: 'Globally unique identifier of the application'\n },\n title: {\n type: 'string',\n description: 'Short title of the application'\n },\n exposedUrl: {\n type: 'string',\n description: 'The URL where this application is exposed'\n },\n href: {\n type: 'string',\n description: 'The URL where this resource can be fetched'\n },\n wsUrl: {\n type: 'string',\n description: 'The URL where this application can be accessed through a websocket'\n },\n owner: {\n $ref: 'https://github.com/data-fair/lib/account#/$defs/accountKeys'\n },\n configuration: {\n type: 'object',\n description: 'A free format configuration object used by applications. A minimal common structure is used to ensure proper linking between applications and datasets and remote services',\n additionalProperties: true,\n properties: {\n datasets: {\n type: 'array',\n items: {\n $ref: '#/$defs/dataset'\n }\n }\n }\n }\n },\n $defs: {\n dataset: {\n type: [\n 'object',\n 'null'\n ],\n required: [\n 'href',\n 'id',\n 'title',\n 'finalizedAt'\n ],\n properties: {\n href: {\n type: 'string'\n },\n id: {\n type: 'string'\n },\n title: {\n type: 'string'\n },\n key: {\n type: 'string',\n description: 'Not the id of the dataset, but a key inside this configuration object to define the role of the dataset in this context.'\n },\n schema: {\n type: 'array',\n items: {\n $ref: '#/$defs/field'\n }\n },\n finalizedAt: {\n type: 'string',\n format: 'date-time'\n }\n }\n },\n field: {\n type: 'object',\n required: [\n 'key',\n 'type'\n ],\n properties: {\n key: {\n type: 'string'\n },\n type: {\n type: 'string'\n },\n format: {\n type: 'string'\n },\n title: {\n type: 'string'\n },\n 'x-originalName': {\n type: 'string'\n },\n 'x-group': { type: 'string' },\n 'x-refersTo': {\n deprecated: true,\n type: ['string', 'null']\n },\n 'x-concept': {\n type: 'object',\n properties: {\n id: { type: 'string' },\n title: { type: 'string' },\n primary: { type: 'boolean' }\n }\n },\n 'x-labels': {\n type: 'object',\n additionalProperties: {\n type: 'string'\n }\n },\n 'x-labelsRestricted': {\n type: 'boolean'\n }\n }\n }\n }\n}\n"]}
|
package/catalog/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,cAAc,kBAAkB,CAAA","sourcesContent":["import type { Capability, Folder, Metadata, Publication, Resource } from './.type/index.js'\n\nexport * from './.type/index.js'\n\n/** Utility type to check if a type T includes a type U */\ntype Includes<T extends any[], U> = U extends T[number] ? true : false\n\n/**\n * Generic catalog plugin interface.\n * @template TCatalogConfig - The type of the catalog configuration.\n * @template TCapabilities - The capabilities of the catalog.\n */\nexport type CatalogPlugin<TCatalogConfig = object, TCapabilities extends Capability[] = Capability[]> =\n BaseCatalogPlugin<TCatalogConfig, TCapabilities> &\n (Includes<TCapabilities, 'import'> extends true ? WithImport<TCatalogConfig, TCapabilities> : {}) &\n (Includes<TCapabilities, 'publishDataset'> extends true ? WithPublishDataset<TCatalogConfig> : {}) &\n (Includes<TCapabilities, 'deletePublication'> extends true ? WithDeletePublication<TCatalogConfig> : {})\n\ntype BaseCatalogPlugin<TCatalogConfig, TCapabilities extends Capability[]> = {\n metadata: CatalogMetadata<TCapabilities>\n configSchema: TCatalogConfig\n /** Function to validates the catalog configuration. */\n assertConfigValid(catalogConfig: any): asserts catalogConfig is TCatalogConfig,\n /**\n * Prepare function to extract secrets to cipher from the configuration,\n * and dynamically update capabilities.\n * This function is called when the catalog configuration is updated.\n * It can be used to:\n * - throw additional errors to validate the config\n * - remove secrets from the config and store them in the secrets object :<br>\n * This function must copy the configuration fields to be encrypted into the secret object,\n * then replace these fields in the configuration with ****.\n * If the received configuration already contains ****, the secret should not be copied.\n * If the field is empty, it should delete the secret.\n * - update the capabilities of the catalog based on the configuration\n *\n * @param context.catalogConfig The catalog configuration, that can contain secrets to extract\n * @param context.capabilities The actuals capabilities of the catalog\n * @param context.secrets The actuals deciphered secrets of the catalog\n * @returns A promise that resolves to an object containing the catalog configuration, capabilities, and secrets.\n */\n prepare: (context: PrepareContext<TCatalogConfig, TCapabilities>) => Promise<{\n catalogConfig?: TCatalogConfig,\n capabilities?: TCapabilities,\n secrets?: Record<string, string>\n }>\n}\n\n/**\n * Type for catalog implementations that support listing and retrieving resources.\n * Resources are organized within folders in the catalog structure.\n *\n * @template TCatalogConfig - Configuration type for the catalog\n * @template TCapabilities - Array of capability types that the catalog supports\n */\ntype WithImport<TCatalogConfig, TCapabilities extends Capability[]> = {\n /** List available folders and resources in the catalog. */\n list: (context: ListContext<TCatalogConfig, TCapabilities>) => Promise<{\n /** The total number of items in the current folder */\n count: number;\n /** The list of folders and resources in the current folder, filtered with the search and pagination parameters */\n results: (Folder | Pick<Resource, 'id' | 'title' | 'description' | 'format' | 'mimeType' | 'origin' | 'size'> & { type: 'resource' })[],\n /** The path to the current folder, including the current folder itself, used to navigate back */\n path: Folder[]\n }>;\n\n /**\n * Download the resource to a temporary file and return the metadata of the resource.\n * @returns A promise that resolves to the metadata of the resource, including the path to the downloaded file.\n */\n getResource: (context: GetResourceContext<TCatalogConfig>) => Promise<Resource | undefined>;\n}\n & (Includes<TCapabilities, 'additionalFilters'> extends true ? { listFiltersSchema: Record<string, any> } : {})\n & (Includes<TCapabilities, 'importConfig'> extends true ? { importConfigSchema: Record<string, any> } : {})\n\ntype WithPublishDataset<TCatalogConfig> = {\n /**\n * Publish/Update a dataset or add/update a resource to a dataset\n * @param catalogConfig The configuration of the catalog\n * @param dataset The datafair dataset to publish\n * @param publication The publication to process\n * @param publicationSite The site where the user will be redirected from the remote dataset\n * @returns A promise that is resolved when the dataset is published\n */\n publishDataset: (context: PublishDatasetContext<TCatalogConfig>) => Promise<Publication>\n}\n\ntype WithDeletePublication<TCatalogConfig> = {\n /**\n * Delete a dataset or remove a resource from a dataset\n * @param catalogConfig The configuration of the catalog\n * @param datasetId The id of the remoteDataset to delete, or the dataset where the resource to delete is\n * @param resourceId The id of the resource to delete\n */\n deleteDataset: (context: DeletePublicationContext<TCatalogConfig>) => Promise<void>\n}\n\n/**\n * Context for preparing a catalog configuration.\n * @template TCatalogConfig - The type of the catalog configuration.\n * @template TCapabilities - The capabilities of the catalog.\n * @property catalogConfig - The catalog configuration, that can contain secrets to extract.\n * @property capabilities - The actuals capabilities of the catalog.\n * @property secrets - The actuals deciphered secrets of the catalog, if any.\n */\nexport type PrepareContext<TCatalogConfig, TCapabilities extends Capability[]> = {\n /** The catalog configuration, that can contain secrets to extract */\n catalogConfig: TCatalogConfig,\n /** The actuals capabilities of the catalog */\n capabilities: TCapabilities,\n /** The actuals deciphered secrets of the catalog */\n secrets: Record<string, string>,\n}\n\nexport type ListContext<TCatalogConfig, TCapabilities extends Capability[]> = {\n /** The catalog configuration */\n catalogConfig: TCatalogConfig,\n /** The deciphered secrets of the catalog */\n secrets: Record<string, string>,\n /** The specific import configuration, if applicable */\n params: ListParams<TCapabilities>\n}\n\n/**\n * Parameters for listing resources in a catalog.\n * @template TCapabilities - The capabilities of the catalog.\n * @property currentFolderId - The ID of the current folder used to list subfolders and resources.\n * @property q - The search field to filter resources when the 'search' capability is included.\n * @property page - The page number for pagination when the 'pagination' capability is included.\n * @property size - The number of items per page for pagination when the 'pagination' capability is included.\n * @property others - Additional filters for the list method when the 'additionalFilters' capability is included.\n */\ntype ListParams<TCapabilities extends Capability[]> = {\n /** The current level folder is used to list subfolders and resources. */\n currentFolderId?: string\n} &\n (Includes<TCapabilities, 'search'> extends true ? SearchParams : {}) &\n (Includes<TCapabilities, 'pagination'> extends true ? PaginationParams : {}) &\n (Includes<TCapabilities, 'additionalFilters'> extends true ? Record<string, string | number> : {})\n\n/** The params q is used to search resources */\ntype SearchParams = { q?: string }\n/** The params page and size are used for pagination */\ntype PaginationParams = { page?: number; size?: number }\n\n/**\n * Context for get and downloading a resource.\n * @template TCatalogConfig - The type of the catalog configuration.\n * @property catalogConfig - The catalog configuration.\n * @property secrets - The deciphered secrets of the catalog.\n * @property importConfig - The specific import configuration, if applicable.\n * @property resourceId - The ID of the remote resource to download.\n * @property tmpDir - The path to the working directory where the resource will be downloaded.\n */\nexport type GetResourceContext<TCatalogConfig> = {\n /** The catalog configuration */\n catalogConfig: TCatalogConfig,\n /** The deciphered secrets of the catalog */\n secrets: Record<string, string>,\n /** The specific import configuration, if applicable */\n importConfig: Record<string, any>\n /** The ID of the remote resource to download */\n resourceId: string,\n /** The path to the working directory where the resource will be downloaded */\n tmpDir: string\n}\n\n/**\n * Context for publishing a dataset.\n * @template TCatalogConfig - The type of the catalog configuration.\n * @property catalogConfig - The catalog configuration.\n * @property secrets - The deciphered secrets of the catalog.\n * @property dataset - The datafair dataset to publish.\n * @property publication - The publication to process.\n * @property publicationSite - The site where the user will be redirected from the remote dataset.\n * @property publicationSite.title - The title of the publication site.\n * @property publicationSite.url - The URL of the publication site.\n * @property publicationSite.datasetUrlTemplate - The template for the URL to view the dataset in the publication site, using url-template syntax.\n */\nexport type PublishDatasetContext<TCatalogConfig> = {\n /** The catalog configuration */\n catalogConfig: TCatalogConfig,\n /** The deciphered secrets of the catalog */\n secrets: Record<string, string>,\n /** The datafair dataset to publish */\n dataset: Record<string, any>,\n /** The publication to process */\n publication: Publication\n /** The site where the user will be redirected from the remote dataset. */\n publicationSite: {\n /** The title of the publication site */\n title: string,\n /** The URL of the publication site */\n url: string,\n /** The template for the URL to view the dataset in the publication site, using url-template syntax. */\n datasetUrlTemplate: string\n }\n}\n\n/**\n * Context for deleting a publication.\n * @template TCatalogConfig - The type of the catalog configuration.\n * @property catalogConfig - The catalog configuration.\n * @property secrets - The deciphered secrets of the catalog.\n * @property datasetId - The ID of the remote dataset to delete, or the dataset where the resource to delete is.\n * @property resourceId - The ID of the resource to delete, if applicable.\n */\nexport type DeletePublicationContext<TCatalogConfig> = {\n /** The catalog configuration */\n catalogConfig: TCatalogConfig,\n /** The deciphered secrets of the catalog */\n secrets: Record<string, string>,\n /** The ID of the remote dataset to delete, or the dataset where the resource to delete is */\n datasetId: string,\n /** The ID of the resource to delete, if applicable */\n resourceId?: string\n}\n\n/**\n * The metadata of the catalog plugin.\n * @template TCapabilities - This ensures that the `capabilities` field in the metadata is of the same type as `TCapabilities`.\n * @property capabilities - The capabilities of the catalog plugin, which is an array of `Capability` types.\n */\nexport type CatalogMetadata<TCapabilities extends Capability[]> = Metadata & {\n /** The capabilities of the catalog plugin */\n capabilities: TCapabilities\n} &\n(Includes<TCapabilities, 'thumbnail'> extends true ? { thumbnailPath: string } : {})\n"]}
|
package/catalog/schema.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,GAAG,EAAE,0CAA0C;IAC/C,WAAW,EAAE,CAAC,OAAO,CAAC;IACtB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,uBAAuB;IA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;oBACV,IAAI,EAAE,SAAS;oBACf,WAAW,EAAE,2EAA2E;iBACzF;aACF;SACF;KACF;CACF,CAAA","sourcesContent":["export default {\n $id: 'https://github.com/data-fair/lib/catalog',\n 'x-exports': ['types'],\n type: 'object',\n title: 'Catalogs common types',\n additionalProperties: false,\n $defs: {\n capability: {\n type: 'string',\n description: `The list of capabilities that a catalog can have.\n - import: The plugin can list some resources organized in folders and import them\n - search: The plugin can use the search param 'q' in the list method\n - pagination: The plugin can paginate the results of the list method\n - additionalFilters: The plugin can use additional filters in the list method\n - importConfig: The plugin gives an import configuration schema\n - publishDataset: The plugin can publish a dataset\n - deletePublication: The plugin can delete a dataset or a resource published in a remote catalog\n - thumbnail: The plugin provides a thumbnail image`,\n enum: [\n 'import',\n 'search',\n 'pagination',\n 'additionalFilters',\n 'importConfig',\n 'publishDataset',\n 'deletePublication',\n 'thumbnail'\n ]\n },\n metadata: {\n type: 'object',\n description: 'The metadata of the catalog plugin',\n required: ['title', 'description', 'capabilities'],\n additionalProperties: false,\n properties: {\n title: {\n description: 'The title of the plugin to be displayed in the UI',\n type: 'string'\n },\n description: {\n description: 'The description of the plugin to be displayed in the UI',\n type: 'string'\n },\n capabilities: {\n description: 'The list of capabilities that a catalog can have.',\n type: 'array',\n items: {\n $ref: '#/$defs/capability'\n }\n },\n thumbnailPath: {\n description: 'Optional path of the thumbnail image from the root of the plugin to be displayed in the UI.',\n type: 'string',\n }\n }\n },\n folder: {\n type: 'object',\n required: ['id', 'title', 'type'],\n additionalProperties: false,\n properties: {\n id: {\n type: 'string'\n },\n title: {\n type: 'string'\n },\n type: {\n const: 'folder',\n }\n },\n },\n resource: {\n type: 'object',\n description: 'The normalized resource to import from a remote catalog to Data Fair',\n required: ['id', 'title', 'filePath', 'format'],\n additionalProperties: false,\n properties: {\n id: {\n type: 'string',\n description: 'The unique identifier of the resource, independent of the folder it is in'\n },\n title: {\n type: 'string',\n description: 'The title of the resource'\n },\n description: {\n type: 'string',\n },\n filePath: {\n type: 'string',\n description: 'The path to the downloaded resource file.',\n },\n format: {\n type: 'string',\n description: 'The format of the resource, e.g. csv, json, xml, etc. It is displayed in the UI of catalogs.',\n },\n // https://www.w3.org/TR/vocab-dcat-2/#Property:dataset_frequency and https://www.dublincore.org/specifications/dublin-core/collection-description/frequency/\n frequency: {\n type: 'string',\n description: 'The frequency of the resource updates, if available. It can be one of the following values: triennial, biennial, annual, semiannual, threeTimesAYear, quarterly, bimonthly, monthly, semimonthly, biweekly, threeTimesAMonth, weekly, semiweekly, threeTimesAWeek, daily, continuous or irregular.',\n enum: ['', 'triennial', 'biennial', 'annual', 'semiannual', 'threeTimesAYear', 'quarterly', 'bimonthly', 'monthly', 'semimonthly', 'biweekly', 'threeTimesAMonth', 'weekly', 'semiweekly', 'threeTimesAWeek', 'daily', 'continuous', 'irregular']\n },\n image: {\n type: 'string',\n description: 'The URL of the image representing the resource, if available'\n },\n license: {\n type: 'object',\n additionalProperties: false,\n required: ['title', 'href'],\n properties: {\n title: {\n type: 'string',\n description: 'Short title for the license'\n },\n href: {\n type: 'string',\n description: 'The URL where the license can be read'\n }\n }\n },\n keywords: {\n type: 'array',\n description: 'The list of keywords associated with the resource, if available',\n items: {\n type: 'string'\n }\n },\n mimeType: {\n type: 'string',\n description: 'The Mime type of the resource, if available'\n },\n origin: {\n type: 'string',\n description: 'The URL where the original data can be found'\n },\n schema: {\n type: 'object',\n additionalProperties: true,\n description: 'The schema of the resource, if available'\n },\n size: {\n type: 'number',\n description: 'The size of the resource in bytes, if available. It is displayed in the UI of catalogs.'\n }\n }\n },\n publication: {\n type: 'object',\n additionalProperties: false,\n description: 'A small object that contains the information needed to publish or update a dataset or a resource',\n properties: {\n remoteDataset: {\n type: 'object',\n required: ['id'],\n additionalProperties: false,\n description: 'Dataset from the remote catalog, used if a local dataset is published as a dataset on a remote catalog. If it is defined during publication, then the remote dataset must be updated.',\n properties: {\n id: {\n type: 'string',\n },\n title: {\n type: 'string',\n },\n url: {\n type: 'string',\n description: 'URL to view the dataset in the remote catalog'\n }\n }\n },\n remoteResource: {\n type: 'object',\n required: ['id'],\n additionalProperties: false,\n description: 'Dataset\\'s resource from the remote catalog, used if a local dataset is published as a resource on a remote catalog. If it is defined during publication, then the remote resource must be updated.',\n properties: {\n id: {\n type: 'string',\n },\n title: {\n type: 'string',\n },\n url: {\n type: 'string',\n description: 'URL to view the resource in the remote catalog'\n }\n }\n },\n isResource: {\n type: 'boolean',\n description: 'If true, the publication is for a resource, otherwise it is for a dataset'\n }\n }\n }\n }\n}\n"]}
|
package/event/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA","sourcesContent":["export * from './.type/index.js'\n"]}
|
package/event/schema.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC;IAClC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,qBAAqB,KAAK,GAAG;IACpC,iBAAiB,EAAE;QACjB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KACzB;IACD,gKAAgK;CACjK,CAAC,CAAA;AAEF,eAAe;IACb,GAAG,EAAE,wCAAwC;IAC7C,WAAW,EAAE,CAAC,OAAO,CAAC;IACtB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC;IACpC,UAAU,EAAE;QACV,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,oBAAoB;SAC5B;QACD,KAAK,EAAE;YACL,KAAK,EAAE,CAAC;oBACN,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,OAAO;iBACf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AoB,EAAE,KAAK;YAC3B,QAAQ,EAAE,CAAC,KAAK,CAAC;YACjB,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,WAAW;iBACnB;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,aAAa;iBACrB;aACF;SACF;KACF;CACF,CAAA","sourcesContent":["const i18nMsg = (title: string) => ({\n type: 'object',\n title: `Internationalized ${title} `,\n patternProperties: {\n '.*': { type: 'string' }\n }\n // properties: ['fr', 'en'].reduce((/** @type {Record<string, any>} */props, locale) => { props[locale] = { type: 'string', title: locale }; return props }, {})\n})\n\nexport default {\n $id: 'https://github.com/data-fair/lib/event',\n 'x-exports': ['types'],\n title: 'Event',\n type: 'object',\n additionalProperties: false,\n required: ['title', 'topic', 'date'],\n properties: {\n _id: {\n type: 'string',\n title: 'Globally unique id'\n },\n title: {\n oneOf: [{\n type: 'string',\n title: 'Title'\n }, i18nMsg('title')]\n },\n body: {\n oneOf: [{\n type: 'string',\n title: 'Content'\n }, i18nMsg('content')]\n },\n htmlBody: {\n oneOf: [{\n type: 'string',\n title: 'HTML content'\n }, i18nMsg('HTML content')]\n },\n icon: {\n type: 'string',\n title: 'URL of event icon'\n },\n // sender is the owner of the topic, topic is global if no sender is given\n sender: { $ref: '#/$defs/sender' },\n // originator is the account/user who triggered the event\n originator: {\n type: 'object',\n properties: {\n internalProcess: {\n type: 'object',\n properties: {\n id: { type: 'string' },\n title: { type: 'string' }\n }\n },\n apiKey: {\n type: 'object',\n properties: {\n id: { type: 'string' },\n title: { type: 'string' }\n }\n },\n user: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n title: 'User ID'\n },\n name: {\n type: 'string',\n title: 'User name'\n },\n email: {\n type: 'string',\n title: 'User email'\n },\n admin: {\n type: 'boolean',\n title: 'User was working as a platform admin'\n }\n }\n },\n organization: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n title: 'Organization ID'\n },\n name: {\n type: 'string',\n title: 'Organization name'\n },\n department: {\n type: 'string',\n title: 'Organization department'\n },\n departmentName: {\n type: 'string',\n title: 'Organization department name'\n }\n }\n }\n }\n },\n topic: { $ref: '#/$defs/topicRef' },\n url: {\n type: 'string',\n title: 'explicitly defined url, alternative is to use urlTemplate in subscription and urlParams',\n },\n urlParams: {\n type: 'object',\n title: 'used to fill subscription.urlTemplate and so create notification.url',\n patternProperties: {\n '.*': { type: 'string' }\n }\n },\n visibility: {\n type: 'string',\n title: 'Visibility',\n enum: ['public', 'private'],\n default: 'private'\n },\n date: {\n type: 'string',\n title: 'Reception date',\n format: 'date-time'\n },\n extra: {\n type: 'object',\n description: 'Free properties that varie depending on the type of event'\n },\n resource: {\n type: 'object',\n title: 'The main resource concerned by the event',\n additionalProperties: false,\n required: ['type', 'id'],\n properties: {\n type: {\n type: 'string',\n title: 'Type'\n },\n id: {\n type: 'string',\n description: 'The unique id of the resource'\n },\n title: {\n type: 'string',\n description: 'The display name of the resource'\n }\n }\n },\n subscribedRecipient: {\n type: 'object',\n title: 'Optional recipient target of the event',\n required: ['id'],\n properties: {\n id: {\n type: 'string',\n description: 'The unique id of the user'\n },\n name: {\n type: 'string',\n description: 'The display name of the user'\n }\n }\n }\n },\n $defs: {\n sender: {\n type: 'object',\n title: 'Emitter',\n additionalProperties: false,\n required: ['type', 'id'],\n properties: {\n type: {\n type: 'string',\n enum: ['user', 'organization'],\n title: 'Type'\n },\n id: {\n type: 'string',\n description: 'The unique id of the user or organization'\n },\n name: {\n type: 'string',\n description: 'The display name of the user or organization'\n },\n role: {\n type: 'string',\n description: 'If this is set and owner is an organization, this restrict ownership to users of this organization having this role or admin role'\n },\n department: {\n type: 'string',\n description: 'If this is set and owner is an organization, this gives ownership to users of this organization that belong to this department'\n },\n departmentName: {\n type: 'string',\n description: 'The display name of the department'\n }\n }\n },\n topicRef: {\n type: 'object',\n additionalProperties: false,\n required: ['key'],\n properties: {\n key: {\n type: 'string',\n title: 'Topic key'\n },\n title: {\n type: 'string',\n title: 'Topic title'\n }\n }\n }\n }\n}\n"]}
|
package/notification/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA","sourcesContent":["export * from './.type/index.js'\n"]}
|
package/notification/schema.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["schema.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,GAAG,EAAE,+CAA+C;IACpD,WAAW,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;IAClC,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC;IACjD,UAAU,EAAE;QACV,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,oBAAoB;SAC5B;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,6DAA6D;SACrE;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,oCAAoC;YAC3C,QAAQ,EAAE,IAAI;SACf;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,OAAO;SACf;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,SAAS;SACjB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,cAAc;SACtB;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,2BAA2B;YAClC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;SACnB;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,oCAAoC;SAC5C;QACD,0EAA0E;QAC1E,MAAM,EAAE,EAAE,IAAI,EAAE,sDAAsD,EAAE;QACxE,KAAK,EAAE,EAAE,IAAI,EAAE,wDAAwD,EAAE;QACzE,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,CAAC,IAAI,CAAC;YAChB,UAAU,EAAE;gBACV,EAAE,EAAE;oBACF,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2BAA2B;iBACzC;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,8BAA8B;iBAC5C;aACF;SACF;QACD,OAAO,EAAE;YACP,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,CAAC;wBACN,KAAK,EAAE,SAAS;wBAChB,KAAK,EAAE,uDAAuD;qBAC/D,EAAE;wBACD,KAAK,EAAE,OAAO;wBACd,KAAK,EAAE,oCAAoC;qBAC5C,CAAC;aACH;SACF;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,yFAAyF;SACjG;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,gBAAgB;YAC7B,MAAM,EAAE,WAAW;SACpB;QACD,GAAG,EAAE;YACH,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,SAAS;SAChB;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mEAAmE;SACjF;KACF;CACF,CAAA","sourcesContent":["export default {\n $id: 'https://github.com/data-fair/lib/notification',\n 'x-exports': ['types', 'validate'],\n title: 'Notification',\n type: 'object',\n additionalProperties: false,\n required: ['title', 'topic', 'recipient', 'date'],\n properties: {\n _id: {\n type: 'string',\n title: 'Globally unique id'\n },\n eventId: {\n type: 'string',\n title: 'Globally unique id of the event source of this notification'\n },\n origin: {\n type: 'string',\n title: 'Site d\\'origine de la souscription',\n readOnly: true\n },\n title: {\n type: 'string',\n title: 'Titre'\n },\n body: {\n type: 'string',\n title: 'Contenu'\n },\n htmlBody: {\n type: 'string',\n title: 'Contenu HTML'\n },\n locale: {\n type: 'string',\n title: 'Langue de la notification',\n enum: ['fr', 'en']\n },\n icon: {\n type: 'string',\n title: 'URL de l\\'icone de la notification'\n },\n // sender is the owner of the topic, topic is global if no sender is given\n sender: { $ref: 'https://github.com/data-fair/lib/event#/$defs/sender' },\n topic: { $ref: 'https://github.com/data-fair/lib/event#/$defs/topicRef' },\n recipient: {\n type: 'object',\n required: ['id'],\n properties: {\n id: {\n type: 'string',\n description: 'The unique id of the user'\n },\n name: {\n type: 'string',\n description: 'The display name of the user'\n }\n }\n },\n outputs: {\n type: 'array',\n title: 'Sorties',\n items: {\n type: 'string',\n oneOf: [{\n const: 'devices',\n title: 'recevoir la notification sur vos appareils configurés'\n }, {\n const: 'email',\n title: 'recevoir la notification par email'\n }]\n }\n },\n url: {\n type: 'string',\n title: 'défini explicitement ou calculé à partir de subscription.urlTemplate et event.urlParams',\n },\n date: {\n type: 'string',\n description: 'reception date',\n format: 'date-time'\n },\n new: {\n readOnly: true,\n type: 'boolean'\n },\n extra: {\n type: 'object',\n description: 'propriétés libres qui varient en fonction du type de notification'\n }\n }\n}\n"]}
|
package/package.json
CHANGED
package/processings.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processings.js","sourceRoot":"","sources":["processings.ts"],"names":[],"mappings":"","sourcesContent":["import type { AxiosInstance } from 'axios'\nimport type { DataFairWsClient } from '@data-fair/lib-node/ws-client.js'\n\n/**\n * Function to prepare a processing (trigger when the config is updated).\n * It can be used to:\n * - throw additional errors to validate the config\n * - remove secrets from the config and store them in the secrets object\n */\nexport type PrepareFunction<TProcessingConfig = any> = (\n context: {\n processingConfig: TProcessingConfig\n secrets: Record<string, string>\n }\n) => Promise<{\n processingConfig?: TProcessingConfig,\n secrets?: Record<string, string>\n}>\n\n/**\n * Function to execute the processing (triggered when the processing is started).\n * This is the main function of the plugin where the business logic is implemented.\n *\n * @returns An object with a optional deleteOnComplete property to indicate that the last run should be deleted after completion.\n */\nexport type RunFunction<TProcessingConfig = any, TPluginConfig = any> = (\n context: ProcessingContext<TProcessingConfig, TPluginConfig>\n) => Promise<void | { deleteOnComplete?: boolean }>\n\n/**\n * Processing context.\n */\nexport interface ProcessingContext<TProcessingConfig = any, TPluginConfig = any> {\n processingConfig: TProcessingConfig\n pluginConfig: TPluginConfig\n secrets?: Record<string, string>\n processingId: string\n dir: string\n tmpDir: string\n log: LogFunctions\n axios: AxiosInstance\n ws: DataFairWsClient\n sendMail: (mail: string) => Promise<void>\n patchConfig: (patch: { datasetMode: string, dataset: any }) => Promise<void>\n}\n\n/**\n * Log functions.\n */\nexport interface LogFunctions {\n step: (msg: string) => Promise<void>\n error: (msg: string, extra?: any) => Promise<void>\n warning: (msg: string, extra?: any) => Promise<void>\n info: (msg: string, extra?: any) => Promise<void>\n debug: (msg: string, extra?: any) => Promise<void>\n task: (name: string) => Promise<void>\n progress: (taskName: string, progress: number, total: number) => Promise<void>\n testInfo?: (msg: any, extra?: any) => void\n testDebug?: (msg: any, extra?: any) => void\n}\n"]}
|
package/session/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAO/D,cAAc,kBAAkB,CAAA;AAEhC,MAAM,UAAU,eAAe,CAAE,YAA0B;IACzD,OAAO,CAAC,CAAC,YAAY,CAAC,IAAI,CAAA;AAC5B,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAE,YAA0B;IAC7D,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC;QAAE,MAAM,SAAS,CAAC,GAAG,CAAC,CAAA;AAC1D,CAAC;AAED,MAAM,UAAU,eAAe,CAAE,YAA0B;IACzD,mBAA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AA;QACvI,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IAAI,YAAY,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC;YAAE,OAAO,YAAY,CAAC,WAAW,CAAA;IAC3G,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAE,YAA0B,EAAE,OAAoB,EAAE,KAAwB,EAAE,UAA6B,EAAE;IAC5I,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,KAAK,GAAG,CAAC,KAAK,CAAC,CAAA;IAC9C,MAAM,WAAW,GAAG,cAAc,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IAClE,IAAI,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC;QAAE,MAAM,SAAS,CAAC,GAAG,EAAE,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AAChH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAE,IAAY;IAC9C,OAAO,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AAChD,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAE,IAAY;IAClD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC;QAAE,MAAM,SAAS,CAAC,GAAG,EAAE,sBAAsB,CAAC,CAAA;AAC7E,CAAC","sourcesContent":["import { type SessionState, type Account } from './.type/index.js'\nimport { httpError } from '@data-fair/lib-utils/http-errors.js'\n\n// same as account, but only the parts necessary in filters, etc\nexport type AccountKeys = Pick<Account, 'type' | 'id' | 'department'>\n\nexport type SessionStateAuthenticated = SessionState & Required<Pick<SessionState, 'user' | 'account' | 'accountRole'>>\n\nexport * from './.type/index.js'\n\nexport function isAuthenticated (sessionState: SessionState): sessionState is SessionStateAuthenticated {\n return !!sessionState.user\n}\n\nexport function assertAuthenticated (sessionState: SessionState): asserts sessionState is SessionStateAuthenticated {\n if (!isAuthenticated(sessionState)) throw httpError(401)\n}\n\nexport function assertAdminMode (sessionState: SessionState): asserts sessionState is SessionStateAuthenticated {\n assertAuthenticated(sessionState)\n // TODO: use sessionState.locale to internationalize error message\n if (!sessionState.user.adminMode) throw httpError(403, 'super admin only')\n}\n\nfunction matchAccount (userAccount: AccountKeys, resourceAccount: AccountKeys, acceptDepAsRoot = false): boolean {\n if (userAccount.type !== resourceAccount.type) return false\n if (userAccount.id !== resourceAccount.id) return false\n if (!acceptDepAsRoot) {\n if (userAccount.department && userAccount.department !== resourceAccount.department) return false\n }\n return true\n}\n\ntype AssertRoleOptions = {\n allAccounts?: boolean,\n acceptDepAsRoot?: boolean\n}\n\nexport function getAccountRole (sessionState: SessionState, account: AccountKeys, options: AssertRoleOptions = {}): string | null {\n if (!isAuthenticated(sessionState)) return null\n if (sessionState.user.adminMode) return 'admin'\n // user is always admin of themself even if currently switched in an orga\n if (account.type === 'user' && sessionState.user.id === account.id) return 'admin'\n if (options.allAccounts) {\n for (const org of sessionState.user.organizations) {\n if (matchAccount({ type: 'organization', id: org.id, department: org.department }, account, options.acceptDepAsRoot)) return org.role\n }\n } else {\n if (matchAccount(sessionState.account, account, options.acceptDepAsRoot)) return sessionState.accountRole\n }\n return null\n}\n\nexport function assertAccountRole (sessionState: SessionState, account: AccountKeys, roles: string | string[], options: AssertRoleOptions = {}) {\n if (typeof roles === 'string') roles = [roles]\n const accountRole = getAccountRole(sessionState, account, options)\n if (!accountRole || !roles.includes(accountRole)) throw httpError(403, `requires ${roles.join(', ')} role(s)`)\n}\n\nexport function isValidAccountType (type: string): type is 'user' | 'organization' {\n return ['user', 'organization'].includes(type)\n}\n\nexport function assertValidAccountType (type: string): asserts type is 'user' | 'organization' {\n if (!isValidAccountType(type)) throw httpError(400, 'invalid account type')\n}\n"]}
|
package/session/schema.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRo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AK,EAAE,sBAAsB;oBAC7B,IAAI,EAAE,CAAC,CAAC,CAAC;iBACV;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,CAAC,CAAC,CAAC;iBACV;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,iBAAiB;iBACxB;gBACD,aAAa,EAAE;oBACb,IAAI,EAAE,SAAS;iBAChB;aACF;SACF;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,oBAAoB,EAAE,KAAK;YAC3B,QAAQ,EAAE;gBACR,MAAM;gBACN,IAAI;gBACJ,MAAM;aACP;YACD,UAAU,EAAE;gBACV,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;iBAC/B;gBACD,EAAE,EAAE;oBACF,IAAI,EAAE,QAAQ;iBACf;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;iBACf;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;CACF,CAAA","sourcesContent":["export default {\n $id: 'https://github.com/data-fair/lib/session-state',\n 'x-exports': ['types', 'validate'],\n type: 'object',\n title: 'session state',\n additionalProperties: false,\n required: ['lang'],\n properties: {\n user: {\n $ref: '#/$defs/user'\n },\n organization: {\n $ref: '#/$defs/organizationMembership'\n },\n account: {\n $ref: '#/$defs/account'\n },\n accountRole: {\n type: 'string'\n },\n siteRole: {\n type: 'string'\n },\n lang: {\n type: 'string'\n },\n dark: {\n deprecated: true,\n type: 'boolean'\n }\n },\n $defs: {\n organizationMembership: {\n type: 'object',\n additionalProperties: false,\n required: [\n 'id',\n 'name',\n 'role'\n ],\n properties: {\n id: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n role: {\n type: 'string'\n },\n roleLabel: {\n type: 'string'\n },\n department: {\n type: 'string'\n },\n departmentName: {\n type: 'string'\n },\n dflt: {\n type: 'integer',\n enum: [1]\n }\n }\n },\n userRef: {\n type: 'object',\n additionalProperties: false,\n required: [\n 'id',\n 'name'\n ],\n properties: {\n id: {\n type: 'string'\n },\n name: {\n type: 'string'\n }\n }\n },\n user: {\n type: 'object',\n additionalProperties: false,\n required: [\n 'email',\n 'id',\n 'name',\n 'organizations'\n ],\n properties: {\n email: {\n type: 'string',\n format: 'email'\n },\n id: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n organizations: {\n type: 'array',\n items: {\n $ref: '#/$defs/organizationMembership'\n }\n },\n isAdmin: {\n type: 'integer',\n enum: [1]\n },\n adminMode: {\n type: 'integer',\n enum: [1]\n },\n asAdmin: {\n $ref: '#/$defs/userRef'\n },\n asAdminOrg: {\n $ref: '#/$defs/organizationMembership'\n },\n pd: {\n type: 'string',\n format: 'date'\n },\n ipa: {\n type: 'integer',\n title: 'short for ignorePersonalAccount',\n enum: [1]\n },\n idp: {\n type: 'integer',\n title: 'Is the user coming from a core ID provider ?',\n enum: [1]\n },\n os: {\n type: 'integer',\n title: 'short for orgStorage',\n enum: [1]\n },\n rememberMe: {\n type: 'integer',\n enum: [1]\n },\n siteOwner: {\n $ref: '#/$defs/account'\n },\n pseudoSession: {\n type: 'boolean'\n }\n }\n },\n account: {\n type: 'object',\n additionalProperties: false,\n required: [\n 'type',\n 'id',\n 'name'\n ],\n properties: {\n type: {\n type: 'string',\n enum: ['user', 'organization']\n },\n id: {\n type: 'string'\n },\n name: {\n type: 'string'\n },\n department: {\n type: 'string'\n },\n departmentName: {\n type: 'string'\n }\n }\n }\n }\n}\n"]}
|
package/theme/.type/index.d.ts
CHANGED
|
@@ -41,15 +41,15 @@ export type CouleurDeTexteAccentue = string;
|
|
|
41
41
|
export type CouleurInfo = string;
|
|
42
42
|
export type CouleurDeTexteSurCouleurInfo = string;
|
|
43
43
|
export type CouleurDeTexteInfo = string;
|
|
44
|
-
export type CouleurSucces = string;
|
|
45
|
-
export type CouleurSucces1 = string;
|
|
46
|
-
export type CouleurDeTexteSucces = string;
|
|
47
44
|
export type CouleurErreur = string;
|
|
48
45
|
export type CouleurDeTexteSurCouleurErreur = string;
|
|
49
46
|
export type CouleurDeTexteErreur = string;
|
|
50
47
|
export type CouleurAvertissement = string;
|
|
51
48
|
export type CouleurDeTexteSurAvertissement = string;
|
|
52
49
|
export type CouleurDeTexteAvertissement = string;
|
|
50
|
+
export type CouleurSucces = string;
|
|
51
|
+
export type CouleurSucces1 = string;
|
|
52
|
+
export type CouleurDeTexteSucces = string;
|
|
53
53
|
export type ProposerCeThemeAuxUtilisateurs = boolean;
|
|
54
54
|
export type ProposerCeThemeAuxUtilisateurs1 = boolean;
|
|
55
55
|
export type ProposerCeThemeAuxUtilisateurs2 = boolean;
|
|
@@ -99,15 +99,15 @@ export type Colors = {
|
|
|
99
99
|
info: CouleurInfo;
|
|
100
100
|
"on-info": CouleurDeTexteSurCouleurInfo;
|
|
101
101
|
"text-info"?: CouleurDeTexteInfo;
|
|
102
|
-
success: CouleurSucces;
|
|
103
|
-
"on-success": CouleurSucces1;
|
|
104
|
-
"text-success"?: CouleurDeTexteSucces;
|
|
105
102
|
error: CouleurErreur;
|
|
106
103
|
"on-error": CouleurDeTexteSurCouleurErreur;
|
|
107
104
|
"text-error"?: CouleurDeTexteErreur;
|
|
108
105
|
warning: CouleurAvertissement;
|
|
109
106
|
"on-warning": CouleurDeTexteSurAvertissement;
|
|
110
107
|
"text-warning"?: CouleurDeTexteAvertissement;
|
|
108
|
+
success: CouleurSucces;
|
|
109
|
+
"on-success": CouleurSucces1;
|
|
110
|
+
"text-success"?: CouleurDeTexteSucces;
|
|
111
111
|
admin: string;
|
|
112
112
|
"on-admin": string;
|
|
113
113
|
"text-admin"?: string;
|
package/theme/index.d.ts
CHANGED
|
@@ -22,22 +22,22 @@ export declare const defaultTheme: {
|
|
|
22
22
|
'text-secondary': string;
|
|
23
23
|
accent: string;
|
|
24
24
|
'on-accent': string;
|
|
25
|
-
'text-accent':
|
|
25
|
+
'text-accent': string;
|
|
26
26
|
info: string;
|
|
27
27
|
'on-info': string;
|
|
28
28
|
'text-info': string;
|
|
29
|
+
warning: string;
|
|
30
|
+
'on-warning': string;
|
|
31
|
+
'text-warning': string;
|
|
32
|
+
error: string;
|
|
33
|
+
'on-error': string;
|
|
34
|
+
'text-error': string;
|
|
29
35
|
success: string;
|
|
30
36
|
'on-success': string;
|
|
31
37
|
'text-success': string;
|
|
32
|
-
error: string;
|
|
33
|
-
'on-error': string;
|
|
34
|
-
'text-error': undefined;
|
|
35
|
-
warning: string;
|
|
36
|
-
'on-warning': string;
|
|
37
|
-
'text-warning': undefined;
|
|
38
38
|
admin: string;
|
|
39
39
|
'on-admin': string;
|
|
40
|
-
'text-admin':
|
|
40
|
+
'text-admin': string;
|
|
41
41
|
};
|
|
42
42
|
dark: boolean;
|
|
43
43
|
darkColors: {
|
|
@@ -52,22 +52,22 @@ export declare const defaultTheme: {
|
|
|
52
52
|
'text-primary': string;
|
|
53
53
|
secondary: string;
|
|
54
54
|
'on-secondary': string;
|
|
55
|
-
'text-secondary':
|
|
55
|
+
'text-secondary': string;
|
|
56
56
|
accent: string;
|
|
57
57
|
'on-accent': string;
|
|
58
58
|
'text-accent': string;
|
|
59
|
-
error: string;
|
|
60
|
-
'on-error': string;
|
|
61
|
-
'text-error': string;
|
|
62
59
|
info: string;
|
|
63
60
|
'on-info': string;
|
|
64
61
|
'text-info': undefined;
|
|
65
|
-
success: string;
|
|
66
|
-
'on-success': string;
|
|
67
|
-
'text-success': undefined;
|
|
68
62
|
warning: string;
|
|
69
63
|
'on-warning': string;
|
|
70
64
|
'text-warning': string;
|
|
65
|
+
error: string;
|
|
66
|
+
'on-error': string;
|
|
67
|
+
'text-error': string;
|
|
68
|
+
success: string;
|
|
69
|
+
'on-success': string;
|
|
70
|
+
'text-success': undefined;
|
|
71
71
|
admin: string;
|
|
72
72
|
'on-admin': string;
|
|
73
73
|
'text-admin': string;
|
|
@@ -88,22 +88,22 @@ export declare const defaultTheme: {
|
|
|
88
88
|
'text-secondary': string;
|
|
89
89
|
accent: string;
|
|
90
90
|
'on-accent': string;
|
|
91
|
-
'text-accent':
|
|
91
|
+
'text-accent': string;
|
|
92
92
|
info: string;
|
|
93
93
|
'on-info': string;
|
|
94
94
|
'text-info': string;
|
|
95
|
-
success: string;
|
|
96
|
-
'on-success': string;
|
|
97
|
-
'text-success': string;
|
|
98
|
-
error: string;
|
|
99
|
-
'on-error': string;
|
|
100
|
-
'text-error': undefined;
|
|
101
95
|
warning: string;
|
|
102
96
|
'on-warning': string;
|
|
103
97
|
'text-warning': undefined;
|
|
98
|
+
error: string;
|
|
99
|
+
'on-error': string;
|
|
100
|
+
'text-error': string;
|
|
101
|
+
success: string;
|
|
102
|
+
'on-success': string;
|
|
103
|
+
'text-success': string;
|
|
104
104
|
admin: string;
|
|
105
105
|
'on-admin': string;
|
|
106
|
-
'text-admin':
|
|
106
|
+
'text-admin': string;
|
|
107
107
|
};
|
|
108
108
|
hcDark: boolean;
|
|
109
109
|
hcDarkColors: {
|
|
@@ -118,22 +118,22 @@ export declare const defaultTheme: {
|
|
|
118
118
|
'text-primary': string;
|
|
119
119
|
secondary: string;
|
|
120
120
|
'on-secondary': string;
|
|
121
|
-
'text-secondary':
|
|
121
|
+
'text-secondary': string;
|
|
122
122
|
accent: string;
|
|
123
123
|
'on-accent': string;
|
|
124
124
|
'text-accent': string;
|
|
125
|
-
error: string;
|
|
126
|
-
'on-error': string;
|
|
127
|
-
'text-error': string;
|
|
128
125
|
info: string;
|
|
129
126
|
'on-info': string;
|
|
130
127
|
'text-info': undefined;
|
|
131
|
-
success: string;
|
|
132
|
-
'on-success': string;
|
|
133
|
-
'text-success': undefined;
|
|
134
128
|
warning: string;
|
|
135
129
|
'on-warning': string;
|
|
136
130
|
'text-warning': string;
|
|
131
|
+
error: string;
|
|
132
|
+
'on-error': string;
|
|
133
|
+
'text-error': string;
|
|
134
|
+
success: string;
|
|
135
|
+
'on-success': string;
|
|
136
|
+
'text-success': undefined;
|
|
137
137
|
admin: string;
|
|
138
138
|
'on-admin': string;
|
|
139
139
|
'text-admin': string;
|
|
@@ -141,6 +141,7 @@ export declare const defaultTheme: {
|
|
|
141
141
|
};
|
|
142
142
|
export declare const getTextColorsCss: (colors: Colors, theme: string) => string;
|
|
143
143
|
export declare const getReadableColor: (baseColor: string, bgColors: string[], darkMode: boolean, level: "AA" | "AAA") => string;
|
|
144
|
+
export declare const getTonalBg: (color: string, bgColor: string) => string;
|
|
144
145
|
export declare const getOnColor: (color: string) => string;
|
|
145
146
|
export declare const fillTheme: (theme: Theme, defaultTheme: Theme) => Required<Pick<Theme, "darkColors" | "hcColors" | "hcDarkColors">> & Theme;
|
|
146
147
|
export declare function getColorsWarnings(locale: 'en' | 'fr', colors: Colors, themeName: string, readableOptions: tinycolor.WCAG2Options): string[];
|