MCPcopy Index your code
hub / github.com/diffgram/diffgram / userscript_new_api

Function userscript_new_api

default/methods/userscript/userscript.py:21–75  ·  view source on GitHub ↗
(project_string_id)

Source from the content-addressed store, hash-verified

19 Roles = ["admin", "Editor"],
20 apis_user_list = ["api_enabled_builder"])
21def userscript_new_api(project_string_id):
22
23 userscript_new_spec_list = [
24 {"name" : {
25 'default': str(time.time()),
26 'kind': str
27 }
28 },
29
30 {"code" : {
31 'default': None,
32 'kind': str,
33 'allow_empty': True
34 }
35 },
36
37 {"language" : {
38 'default': None,
39 'kind': str,
40 'valid_values_list': ['javascript']
41 }
42 },
43 {"external_src_list" : {
44 'default': None,
45 'kind': list,
46 'allow_empty': True
47 }
48 },
49 {"client_created_time" : {
50 'default': None,
51 'kind': datetime,
52 }
53 },
54 {"client_creation_ref_id" : {
55 'default': None,
56 'kind': str,
57 }
58 }
59 ]
60 log, input, untrusted_input = regular_input.master(request = request,
61 spec_list = userscript_new_spec_list)
62 if len(log["error"].keys()) >= 1: return jsonify(log = log), 400
63
64 with sessionMaker.session_scope() as session:
65
66 userscript = __userscript_new(
67 session = session,
68 input = input,
69 project_string_id = project_string_id)
70
71 log['success'] = True
72
73 return jsonify(
74 userscript = userscript.serialize(),
75 log = log), 200
76
77
78def __userscript_new(

Callers

nothing calls this directly

Calls 2

__userscript_newFunction · 0.85
serializeMethod · 0.45

Tested by

no test coverage detected