190 lines
No EOL
4.6 KiB
JSON
190 lines
No EOL
4.6 KiB
JSON
{
|
|
"type": "plugin",
|
|
"meta": {
|
|
"docsUrl": "https://v2.quasar.dev/quasar-plugins/cookies"
|
|
},
|
|
"injection": "$q.cookies",
|
|
"methods": {
|
|
"get": {
|
|
"tsType": "CookiesGetMethodType",
|
|
"desc": "Get cookie",
|
|
"params": {
|
|
"name": {
|
|
"type": "String",
|
|
"desc": "Cookie name",
|
|
"required": true,
|
|
"examples": [
|
|
"userId"
|
|
]
|
|
}
|
|
},
|
|
"returns": {
|
|
"type": [
|
|
"String",
|
|
"null"
|
|
],
|
|
"desc": "Cookie value; Returns null if cookie not found",
|
|
"examples": [
|
|
"john12"
|
|
]
|
|
}
|
|
},
|
|
"getAll": {
|
|
"desc": "Get all cookies",
|
|
"returns": {
|
|
"type": "Object",
|
|
"desc": "Object with cookie names (as keys) and their values",
|
|
"examples": [
|
|
"{ userId: 'john12', XFrame: 'x534' }"
|
|
]
|
|
}
|
|
},
|
|
"set": {
|
|
"desc": "Set cookie",
|
|
"params": {
|
|
"name": {
|
|
"type": "String",
|
|
"desc": "Cookie name",
|
|
"required": true,
|
|
"examples": [
|
|
"userId"
|
|
]
|
|
},
|
|
"value": {
|
|
"type": "String",
|
|
"desc": "Cookie value",
|
|
"required": true,
|
|
"examples": [
|
|
"john12"
|
|
]
|
|
},
|
|
"options": {
|
|
"type": "Object",
|
|
"desc": "Cookie options",
|
|
"definition": {
|
|
"expires": {
|
|
"type": [
|
|
"Number",
|
|
"String",
|
|
"Date"
|
|
],
|
|
"desc": "Cookie expires detail; If specified as Number, then the unit is days; If specified as String, it can either be raw stringified date or in Xd Xh Xm Xs format (see examples)",
|
|
"examples": [
|
|
30,
|
|
"Wed, 13 Jan 2021 22:23:01 GMT",
|
|
"1d",
|
|
"15m",
|
|
"13d",
|
|
"1d 15m",
|
|
"1d 3h 5m 3s"
|
|
]
|
|
},
|
|
"path": {
|
|
"type": "String",
|
|
"desc": "Cookie path",
|
|
"examples": [
|
|
"/accounts"
|
|
]
|
|
},
|
|
"domain": {
|
|
"type": "String",
|
|
"desc": "Cookie domain",
|
|
"examples": [
|
|
".foo.com"
|
|
]
|
|
},
|
|
"sameSite": {
|
|
"type": "String",
|
|
"desc": "SameSite cookie option",
|
|
"values": [
|
|
"Lax",
|
|
"Strict",
|
|
"None"
|
|
]
|
|
},
|
|
"httpOnly": {
|
|
"type": "Boolean",
|
|
"desc": "Is cookie Http Only?"
|
|
},
|
|
"secure": {
|
|
"type": "Boolean",
|
|
"desc": "Is cookie secure? (https only)"
|
|
},
|
|
"other": {
|
|
"type": "String",
|
|
"desc": "Raw string for other cookie options; To be used as a last resort for possible newer props that are currently not yet implemented in Quasar",
|
|
"examples": [
|
|
"SomeNewCookieProp"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"has": {
|
|
"desc": "Check if cookie exists",
|
|
"params": {
|
|
"name": {
|
|
"type": "String",
|
|
"desc": "Cookie name",
|
|
"required": true,
|
|
"examples": [
|
|
"userId"
|
|
]
|
|
}
|
|
},
|
|
"returns": {
|
|
"type": "Boolean",
|
|
"desc": "Does cookie exists or not?"
|
|
}
|
|
},
|
|
"remove": {
|
|
"desc": "Remove a cookie",
|
|
"params": {
|
|
"name": {
|
|
"type": "String",
|
|
"desc": "Cookie name",
|
|
"required": true,
|
|
"examples": [
|
|
"userId"
|
|
]
|
|
},
|
|
"options": {
|
|
"type": "Object",
|
|
"desc": "Cookie options",
|
|
"definition": {
|
|
"path": {
|
|
"type": "String",
|
|
"desc": "Cookie path",
|
|
"examples": [
|
|
"/accounts"
|
|
]
|
|
},
|
|
"domain": {
|
|
"type": "String",
|
|
"desc": "Cookie domain",
|
|
"examples": [
|
|
".foo.com"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"parseSSR": {
|
|
"desc": "For SSR usage only, and only on the global import (not on $q.cookies)",
|
|
"params": {
|
|
"ssrContext": {
|
|
"type": "Object",
|
|
"desc": "SSR Context Object",
|
|
"required": true
|
|
}
|
|
},
|
|
"returns": {
|
|
"type": "Object",
|
|
"tsType": "Cookies",
|
|
"desc": "Cookie object (like $q.cookies) for SSR usage purposes"
|
|
}
|
|
}
|
|
}
|
|
} |