234 attempt to fix js error Uncaught SyntaxError: Unexpected identifier 'hidden'
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/basicauth">
|
||||
|
||||
<cffunction name="get">
|
||||
<cfargument name="username" default="" />
|
||||
<cfargument name="password" default="" />
|
||||
<cfreturn representationOf(arguments) />
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
@@ -1,11 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/conflict/{URI}, /conflict/{URI}" hint="I have multiple uris">
|
||||
|
||||
<cffunction name="get">
|
||||
<cfargument name="uri" type="string" default="0" />
|
||||
<cfset local.res = {} />
|
||||
<cfset local.res.uri = arguments.uri />
|
||||
|
||||
<cfreturn representationOf(local.res) />
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
@@ -1,27 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/echo/{id}" hint="I am the component hint.">
|
||||
|
||||
<cfproperty name="dependency1" />
|
||||
|
||||
<cffunction name="get" hint="I am the function hint.">
|
||||
<cfargument name="id" hint="I am the argument hint." />
|
||||
<cfset local.headers = {}/>
|
||||
<cfset local.headers['x-dude'] = "dude!" />
|
||||
<cfset local.res = {} />
|
||||
<cfset local.res["id"] = arguments.id />
|
||||
<cfif structKeyExists(arguments, "dataFromOTR")>
|
||||
<cfset local.res.dataFromOTR = arguments.dataFromOTR />
|
||||
</cfif>
|
||||
<cfreturn representationOf(local.res).withStatus(999).withHeaders(local.headers) />
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="put">
|
||||
<cfargument name="id" />
|
||||
<cfreturn representationOf(arguments).withStatus(200) />
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="post">
|
||||
<cfargument name="id" />
|
||||
<cfreturn representationOf(arguments).withStatus(200) />
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
@@ -1,38 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/echo/tunnel/{id}">
|
||||
|
||||
<cffunction name="get">
|
||||
<cfargument name="id" />
|
||||
|
||||
<cfset var echo = {} />
|
||||
<cfset echo.actualMethod = "get" />
|
||||
|
||||
<cfreturn representationOf(echo) />
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="put">
|
||||
<cfargument name="id" />
|
||||
|
||||
<cfset var echo = {} />
|
||||
<cfset echo.actualMethod = "put" />
|
||||
|
||||
<cfreturn representationOf(echo).withStatus(200) />
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="post">
|
||||
<cfargument name="id" />
|
||||
|
||||
<cfset var echo = {} />
|
||||
<cfset echo.actualMethod = "post" />
|
||||
|
||||
<cfreturn representationOf(echo).withStatus(201) />
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="delete">
|
||||
<cfargument name="id" />
|
||||
|
||||
<cfset var echo = {} />
|
||||
<cfset echo.actualMethod = "delete" />
|
||||
|
||||
<cfreturn representationOf(echo).withStatus(200) />
|
||||
</cffunction>
|
||||
</cfcomponent>
|
||||
@@ -1,26 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/echo_regex/{id:\d{5}}">
|
||||
|
||||
<cffunction name="get">
|
||||
<cfargument name="id" />
|
||||
<cfset local.headers = {}/>
|
||||
<cfset local.headers['x-dude'] = "dude!" />
|
||||
<cfreturn representationOf(arguments).withStatus(999).withHeaders(local.headers) />
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="put">
|
||||
<cfargument name="id" />
|
||||
<cfreturn representationOf(arguments).withStatus(200) />
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="post">
|
||||
<cfargument name="id" />
|
||||
<cfreturn representationOf(arguments).withStatus(200) />
|
||||
</cffunction>
|
||||
|
||||
|
||||
<cffunction name="setDependency2">
|
||||
<cfargument name="dependency2" />
|
||||
<cfset this.dependency2 = arguments.dependency2 />
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
@@ -1,21 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/echo_alias/{id}, /echo_alias" hint="I have multiple uris">
|
||||
|
||||
<cffunction name="get">
|
||||
<cfargument name="id" default="0" />
|
||||
<cfset local.res = {} />
|
||||
<cfset local.res.id = arguments.id />
|
||||
|
||||
<cfreturn representationOf(local.res) />
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="put">
|
||||
<cfargument name="id" />
|
||||
<cfreturn representationOf(arguments).withStatus(200) />
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="post">
|
||||
<cfargument name="id" />
|
||||
<cfreturn representationOf(arguments).withStatus(200) />
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
@@ -0,0 +1,14 @@
|
||||
component extends="core.resource" taffy:uri="/users/{userId}/orders/{orderId}" {
|
||||
|
||||
/**
|
||||
* GET /users/{userId}/orders/{orderId} - Returns order for a user
|
||||
*/
|
||||
function get(required string userId, required string orderId) {
|
||||
return rep({
|
||||
userId: arguments.userId,
|
||||
orderId: arguments.orderId,
|
||||
method: "GET"
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
component extends="core.resource" taffy:uri="/simple" {
|
||||
|
||||
/**
|
||||
* GET /simple - Returns a simple response
|
||||
*/
|
||||
function get() {
|
||||
return rep({ message: "Hello from simple resource", method: "GET" });
|
||||
}
|
||||
|
||||
/**
|
||||
* POST /simple - Creates something
|
||||
*/
|
||||
function post(string name = "") {
|
||||
return rep({ message: "Created", name: arguments.name, method: "POST" })
|
||||
.withStatus(201, "Created");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
component extends="core.resource" taffy:uri="/items/{id}" {
|
||||
|
||||
/**
|
||||
* GET /items/{id} - Returns an item by ID
|
||||
*/
|
||||
function get(required string id) {
|
||||
return rep({ id: arguments.id, name: "Item #arguments.id#", method: "GET" });
|
||||
}
|
||||
|
||||
/**
|
||||
* PUT /items/{id} - Updates an item
|
||||
*/
|
||||
function put(required string id, string name = "") {
|
||||
return rep({ id: arguments.id, name: arguments.name, updated: true, method: "PUT" });
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE /items/{id} - Deletes an item
|
||||
*/
|
||||
function delete(required string id) {
|
||||
return rep({ id: arguments.id, deleted: true, method: "DELETE" });
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
component extends="core.resource" taffy:uri="/custom" {
|
||||
|
||||
/**
|
||||
* Standard GET method
|
||||
*/
|
||||
function get() {
|
||||
return rep({ message: "Standard GET", method: "GET" });
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom PATCH method using taffy_verb metadata
|
||||
*/
|
||||
function updatePartial() taffy_verb="PATCH" {
|
||||
return rep({ message: "Custom PATCH handler", method: "PATCH" });
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom OPTIONS method using taffy_verb metadata (underscore style)
|
||||
*/
|
||||
function handleOptions() taffy_verb="OPTIONS" {
|
||||
return rep({ message: "Custom OPTIONS handler", method: "OPTIONS" });
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/upload">
|
||||
|
||||
<cffunction name="post">
|
||||
<cfargument name="img" />
|
||||
<cfset var local = structNew() />
|
||||
|
||||
<!--- accept the upload --->
|
||||
<cffile action="upload" destination="#getTempDirectory()#" filefield="img" result="local.r" />
|
||||
|
||||
<!--- delete the file --->
|
||||
<cffile action="delete" file="#local.r.serverdirectory#/#local.r.serverfile#" />
|
||||
|
||||
<cfreturn representationOf( local.r ).withStatus(200) />
|
||||
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
@@ -1,22 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.nativeJsonSerializer">
|
||||
|
||||
<cfproperty name="dependency1" />
|
||||
|
||||
<cffunction name="getAsJSON" output="false"
|
||||
taffy_mime="text/json"
|
||||
taffy_default="true"
|
||||
hint="serializes data as JSON">
|
||||
|
||||
<cfreturn super.getAsJson() />
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="getAsXML" output="false" taffy:mime="text/xml">
|
||||
<cfreturn "FAIL FAIL FAIL" />
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="setDependency2">
|
||||
<cfargument name="dependency2" />
|
||||
<cfset this.dependency2 = arguments.dependency2 />
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
@@ -1 +0,0 @@
|
||||
<cfcomponent></cfcomponent>
|
||||
@@ -1 +0,0 @@
|
||||
<cfcomponent></cfcomponent>
|
||||
@@ -1,7 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/throwException">
|
||||
|
||||
<cffunction name="get">
|
||||
<cfthrow message="this is the exception message." detail="this is the exception detail." />
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
@@ -1,7 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/uriWithForwardSlash{,},uriAliasWithoutFowardSlash">
|
||||
|
||||
<cffunction name="get">
|
||||
<cfreturn noData() />
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
@@ -1,7 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="/echo/towel">
|
||||
|
||||
<cffunction name="get">
|
||||
<cfreturn representationOf("don't panic!").withStatus(200) />
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
@@ -1,7 +0,0 @@
|
||||
<cfcomponent extends="taffy.core.resource" taffy:uri="uriWithoutForwardSlash">
|
||||
|
||||
<cffunction name="get">
|
||||
<cfreturn noData() />
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
Reference in New Issue
Block a user