Skip to content

Commit

Permalink
fix: use AttributeDefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed Feb 15, 2024
1 parent 2c498fc commit 5b9ba5a
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion src/attributes.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
/**
* @typedef {import('pacc').AttributeDefinition} AttributeDefinition
*/

/**
* common attributes
* @type {AttributeDefinition}
*/
export const default_attribute = {
type: "string",
Expand All @@ -11,36 +16,68 @@ export const default_attribute = {
env: []
};

/**
* @type {AttributeDefinition}
*/
export const boolean_attribute = {
...default_attribute,
writable: true,
default: false,
type: "boolean"
};

/**
* @type {AttributeDefinition}
*/
export const boolean_read_only_attribute = {
...default_attribute,
type: "boolean",
default: false
};

/**
* @type {AttributeDefinition}
*/
export const uuid_attribute = {
...default_attribute,
isKey: true
};

/**
* @type {AttributeDefinition}
*/
export const empty_attiribute = { ...default_attribute, type: "boolean" };

/**
* @type {AttributeDefinition}
*/
export const secret_attribute = {
...default_attribute,
private: true,
writable: true
};

/**
* @type {AttributeDefinition}
*/
export const count_attribute = { ...default_attribute, type: "integer" };

/**
* @type {AttributeDefinition}
*/
export const size_attribute = { ...default_attribute, type: "integer" };

/**
* @type {AttributeDefinition}
*/
export const name_attribute = {
...default_attribute,
isKey: true
};

/**
* @type {AttributeDefinition}
*/
export const url_attribute = {
...default_attribute,
description: "home of the object",
Expand All @@ -49,6 +86,7 @@ export const url_attribute = {

/**
* The description of the object content.
* @type {AttributeDefinition}
*/
export const description_attribute = {
...default_attribute,
Expand All @@ -58,20 +96,25 @@ export const description_attribute = {

/**
* Unique id within the provider.
* @type {AttributeDefinition}
*/
export const id_attribute = {
...default_attribute,
isKey: true,
description: "internal identifier"
};

/**
* @type {AttributeDefinition}
*/
export const state_attribute = {
...default_attribute,
writable: true
};

/**
* The description of the pull request.
* @type {AttributeDefinition}
*/
export const body_attribute = {
...default_attribute,
Expand All @@ -80,6 +123,7 @@ export const body_attribute = {

/**
* The one line description of the pull request.
* @type {AttributeDefinition}
*/
export const title_attribute = {
...default_attribute,
Expand All @@ -89,7 +133,8 @@ export const title_attribute = {

/**
* In case there are several providers able to support a given source which one sould be used ?
* this defines the order
* this defines the order.
* @type {AttributeDefinition}
*/
export const priority_attribute = {
...default_attribute,
Expand All @@ -98,12 +143,22 @@ export const priority_attribute = {
writable: true
};

/**
* @type {AttributeDefinition}
*/
export const active_attribute = {
...default_attribute,
type: "boolean",
default: true,
writable: true
};

/**
* @type {AttributeDefinition}
*/
export const language_attribute = default_attribute;

/**
* @type {AttributeDefinition}
*/
export const type_attribute = default_attribute;

0 comments on commit 5b9ba5a

Please sign in to comment.