@servicenow/sdk - v4.13.3
    Preparing search index...

    Variable sys_ws_operationConst

    sys_ws_operation: {
        actions: { create: false; delete: false; read: true; update: false };
        allowClientScripts: false;
        allowNewFields: false;
        allowUiActions: false;
        allowWebServiceAccess: true;
        attributes: {
            "all_tables.text_index_translations": true;
            update_synch: true;
        };
        extends: "sys_metadata";
        label: "Scripted REST Resource";
        name: "sys_ws_operation";
        schema: {
            active: Typed<
                boolean,
                {
                    default: true;
                    label: [
                        {
                            hint: "Activates the resource Inactive resources cannot serve requests.";
                            label: "Active";
                            plural: "Active";
                        },
                    ];
                    maxLength: 30;
                },
            >;
            consumes: Typed<
                string,
                {
                    attributes: { edge_encryption_enabled: true };
                    default: "javascript:current.consumes = current.web_service_definition.consumes";
                    label: [
                        {
                            hint: "Comma-delimited list of media types this resource can consume";
                            label: "Supported request formats";
                            plural: "Supported request formats";
                        },
                    ];
                    maxLength: 200;
                },
            >;
            consumes_customized: Typed<
                boolean,
                {
                    default: false;
                    label: [
                        {
                            hint: "Check to customize the request media types supported by this resource";
                            label: "Override supported request formats";
                            plural: "Override supported request formats";
                        },
                    ];
                    maxLength: 30;
                },
            >;
            default_operation_uri: Typed<
                string,
                {
                    attributes: { edge_encryption_enabled: true };
                    dynamicValueDefinitions: {
                        calculatedValue: "function normalizePath(path) {\n\t// replace repeating '/' chars with a single '/'\n\tpath = path.replace(/\\/+/g, '/');\n\tpath = path.trim();\n\t// remove the trailing '/' if present\n\tif (path.charAt(path.length-1) == '/') {\n\t\tpath = path.substring(0, path.length-1);\n\t}\n\treturn path;\n}\n\nfunction operationInDefaultVersion() {\n\treturn (current.web_service_version != '' &&\n\t\tcurrent.web_service_definition.default_version == current.web_service_version.version_id);\n}\n\nfunction resolveDefaultOperationPath() {\n\t// if not versioned or operation belongs to default version\n\tif (operationInDefaultVersion()) {\n\t\tvar endpointPath = current.web_service_definition.base_uri + '/' + current.relative_path;\n\t\treturn normalizePath(endpointPath);\n\t}\n\t\n\treturn '';\n}\n\ncurrent.default_operation_uri = resolveDefaultOperationPath();";
                        type: "calculated_value";
                    };
                    label: [
                        {
                            hint: "The resolved default (non-versioned) path of this resource including base API path, version, and relative path, if this resource belongs to the default API version";
                            label: "Default resource path";
                            plural: "Default resource paths";
                        },
                    ];
                    maxLength: 255;
                    readOnly: true;
                    readOnlyOption: "instance_configured";
                },
            >;
            enforce_acl: Typed<
                string
                | string[]
                | Record<"sys_security_acl">[],
                {
                    attributes: { no_sort: true; slushbucket_ref_no_expand: true };
                    default: "javascript:current.enforce_acl = current.web_service_definition.enforce_acl";
                    label: [
                        {
                            hint: "The ACL authorization to enforce when accessing this resource If not set, the default ACL authorization from the parent API is enforced if it is set.";
                            label: "ACLs";
                            plural: "ACLs";
                        },
                    ];
                    maxLength: 16777215;
                    referenceQual: "type=REST_Endpoint^operation=execute^EQ";
                    referenceTable: "sys_security_acl";
                    useReferenceQualifier: "simple";
                },
            >;
            http_method: Typed<
                "GET"
                | "POST"
                | "PUT"
                | "PATCH"
                | "DELETE",
                {
                    choices: {
                        DELETE: { label: "DELETE"; sequence: 50 };
                        GET: { label: "GET"; sequence: 10 };
                        PATCH: { label: "PATCH"; sequence: 40 };
                        POST: { label: "POST"; sequence: 20 };
                        PUT: { label: "PUT"; sequence: 30 };
                    };
                    default: "GET";
                    dropdown: "dropdown_without_none";
                    label: [
                        {
                            hint: "The HTTP method that maps to this resource";
                            label: "HTTP method";
                            plural: "HTTP methods";
                        },
                    ];
                    mandatory: true;
                    maxLength: 40;
                },
            >;
            name: Typed<
                string,
                {
                    attributes: { edge_encryption_enabled: true };
                    label: [
                        {
                            hint: "The name of this API resource. Appears in API documentation.";
                            label: "Name";
                            plural: "Names";
                        },
                    ];
                    mandatory: true;
                    maxLength: 40;
                },
            >;
            operation_script: Typed<
                string
                | ScriptModule<Function>,
                {
                    default: "(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {\r\n\r\n // implement resource here\r\n\r\n})(request, response);";
                    label: [
                        {
                            hint: "The script that implements the resource";
                            label: "Script";
                            plural: "Scripts";
                        },
                    ];
                    mandatory: true;
                    maxLength: 16777215;
                },
            >;
            operation_uri: Typed<
                string,
                {
                    attributes: { edge_encryption_enabled: true };
                    dynamicValueDefinitions: {
                        calculatedValue: "function normalizePath(path) {\n\t// replace repeating '/' chars with a single '/'\n\tpath = path.replace(/\\/+/g, '/');\n\tpath = path.trim();\n\t// remove the trailing '/' if present\n\tif (path.charAt(path.length-1) == '/')\n\t\tpath = path.substring(0, path.length-1);\n\t\n\treturn path;\n}\n\nfunction resolveOperationUri() {\n\tif (current.web_service_definition != '') {\n\t\tvar versionId = '';\n\t\tif (current.web_service_version != '')\n\t\t\tversionId = current.web_service_version.version_id + '/';\n\t\t\n\t\tvar endpointPath = '/api/' + current.web_service_definition.namespace + '/' + versionId\n\t\t+ current.web_service_definition.service_id\n\t\t+ '/' + current.relative_path;\n\t\t\n\t\treturn normalizePath(endpointPath);\n\t}\n\treturn '';\n}\n\ncurrent.operation_uri = resolveOperationUri();";
                        type: "calculated_value";
                    };
                    label: [
                        {
                            hint: "The resolved path of this resource including base API path, version, and relative path";
                            label: "Resource path";
                            plural: "Resource paths";
                        },
                    ];
                    maxLength: 255;
                    readOnly: true;
                    readOnlyOption: "instance_configured";
                },
            >;
            produces: Typed<
                string,
                {
                    attributes: { edge_encryption_enabled: true };
                    default: "javascript:current.produces = current.web_service_definition.produces";
                    label: [
                        {
                            hint: "Comma-delimited list of media types this resource can produce";
                            label: "Supported response formats";
                            plural: "Supported response formats";
                        },
                    ];
                    maxLength: 200;
                },
            >;
            produces_customized: Typed<
                boolean,
                {
                    default: false;
                    label: [
                        {
                            hint: "Check to customize the response media types supported by this resource";
                            label: "Override supported response formats";
                            plural: "Override supported response formats";
                        },
                    ];
                    maxLength: 30;
                },
            >;
            relative_path: Typed<
                string,
                {
                    attributes: { edge_encryption_enabled: true };
                    default: "/";
                    label: [
                        {
                            hint: "The path of this resource relative to the base API path. Can contain templatized path parameters such as /{id}.";
                            label: "Relative path";
                            plural: "Relative paths";
                        },
                    ];
                    maxLength: 255;
                },
            >;
            request_example: Typed<
                string,
                {
                    attributes: { edge_encryption_enabled: true };
                    label: [
                        {
                            hint: "An example request payload. Appears in API documentation.";
                            label: "Request body example";
                            plural: "Request body examples";
                        },
                    ];
                    maxLength: 16777215;
                },
            >;
            requires_acl_authorization: Typed<
                boolean,
                {
                    label: [
                        {
                            hint: "Enforce ACLs when this resource is accessed";
                            label: "Requires ACL authorization";
                            plural: "Requires ACL authorizations";
                        },
                    ];
                    maxLength: 30;
                },
            >;
            requires_authentication: Typed<
                boolean,
                {
                    default: true;
                    label: [
                        {
                            hint: "Whether requests must be authenticated to access this resource";
                            label: "Requires authentication";
                            plural: "Requires authentications";
                        },
                    ];
                    maxLength: 30;
                },
            >;
            requires_snc_internal_role: Typed<
                boolean,
                { default: true; label: "Requires SNC Internal"; maxLength: 40 },
            >;
            short_description: Typed<
                string,
                {
                    attributes: { edge_encryption_enabled: true };
                    label: [
                        {
                            hint: "The description of the resource. Appears in API documentation.";
                            label: "Short description";
                            plural: "Short descriptions";
                        },
                    ];
                    maxLength: 80;
                },
            >;
            support_trailing_slash: Typed<
                boolean,
                {
                    default: false;
                    label: [
                        {
                            hint: "Enabling allows this resource to be accessed with or without a trailing slash. Example: /resource and /resource/.";
                            label: "Support Trailing Slash";
                            plural: "Support Trailing Slashes";
                        },
                    ];
                    maxLength: 30;
                },
            >;
            web_service_definition: Typed<
                | string
                | Record<"sys_ws_definition">
                | ExplicitKey<"sys_ws_definition">
                | TableBrand<"sys_ws_definition">,
                {
                    attributes: { readonly_clickthrough: true };
                    cascadeRule: "delete";
                    label: [
                        {
                            hint: "The parent API this resource belongs to";
                            label: "API definition";
                            plural: "API definitions";
                        },
                    ];
                    mandatory: true;
                    maxLength: 32;
                    readOnly: true;
                    readOnlyOption: "instance_configured";
                    referenceTable: "sys_ws_definition";
                },
            >;
            web_service_version: Typed<
                | string
                | Record<"sys_ws_version">
                | ExplicitKey<"sys_ws_version">
                | TableBrand<"sys_ws_version">,
                {
                    attributes: { encode_utf8: false; ref_ac_order_by: "version" };
                    cascadeRule: "delete";
                    label: [
                        {
                            hint: "The version this resource belongs to";
                            label: "API version";
                            plural: "API versions";
                        },
                    ];
                    mandatory: false;
                    maxLength: 32;
                    referenceQual: "javascript:'web_service_definition=' + current.web_service_definition";
                    referenceTable: "sys_ws_version";
                },
            >;
        };
        textIndex: true;
    } = ...

    Type Declaration

    • Readonlyactions: { create: false; delete: false; read: true; update: false }
    • ReadonlyallowClientScripts: false
    • ReadonlyallowNewFields: false
    • ReadonlyallowUiActions: false
    • ReadonlyallowWebServiceAccess: true
    • Readonlyattributes: { "all_tables.text_index_translations": true; update_synch: true }
    • Readonlyextends: "sys_metadata"
    • Readonlylabel: "Scripted REST Resource"
    • Readonlyname: "sys_ws_operation"
    • Readonlyschema: {
          active: Typed<
              boolean,
              {
                  default: true;
                  label: [
                      {
                          hint: "Activates the resource Inactive resources cannot serve requests.";
                          label: "Active";
                          plural: "Active";
                      },
                  ];
                  maxLength: 30;
              },
          >;
          consumes: Typed<
              string,
              {
                  attributes: { edge_encryption_enabled: true };
                  default: "javascript:current.consumes = current.web_service_definition.consumes";
                  label: [
                      {
                          hint: "Comma-delimited list of media types this resource can consume";
                          label: "Supported request formats";
                          plural: "Supported request formats";
                      },
                  ];
                  maxLength: 200;
              },
          >;
          consumes_customized: Typed<
              boolean,
              {
                  default: false;
                  label: [
                      {
                          hint: "Check to customize the request media types supported by this resource";
                          label: "Override supported request formats";
                          plural: "Override supported request formats";
                      },
                  ];
                  maxLength: 30;
              },
          >;
          default_operation_uri: Typed<
              string,
              {
                  attributes: { edge_encryption_enabled: true };
                  dynamicValueDefinitions: {
                      calculatedValue: "function normalizePath(path) {\n\t// replace repeating '/' chars with a single '/'\n\tpath = path.replace(/\\/+/g, '/');\n\tpath = path.trim();\n\t// remove the trailing '/' if present\n\tif (path.charAt(path.length-1) == '/') {\n\t\tpath = path.substring(0, path.length-1);\n\t}\n\treturn path;\n}\n\nfunction operationInDefaultVersion() {\n\treturn (current.web_service_version != '' &&\n\t\tcurrent.web_service_definition.default_version == current.web_service_version.version_id);\n}\n\nfunction resolveDefaultOperationPath() {\n\t// if not versioned or operation belongs to default version\n\tif (operationInDefaultVersion()) {\n\t\tvar endpointPath = current.web_service_definition.base_uri + '/' + current.relative_path;\n\t\treturn normalizePath(endpointPath);\n\t}\n\t\n\treturn '';\n}\n\ncurrent.default_operation_uri = resolveDefaultOperationPath();";
                      type: "calculated_value";
                  };
                  label: [
                      {
                          hint: "The resolved default (non-versioned) path of this resource including base API path, version, and relative path, if this resource belongs to the default API version";
                          label: "Default resource path";
                          plural: "Default resource paths";
                      },
                  ];
                  maxLength: 255;
                  readOnly: true;
                  readOnlyOption: "instance_configured";
              },
          >;
          enforce_acl: Typed<
              string
              | string[]
              | Record<"sys_security_acl">[],
              {
                  attributes: { no_sort: true; slushbucket_ref_no_expand: true };
                  default: "javascript:current.enforce_acl = current.web_service_definition.enforce_acl";
                  label: [
                      {
                          hint: "The ACL authorization to enforce when accessing this resource If not set, the default ACL authorization from the parent API is enforced if it is set.";
                          label: "ACLs";
                          plural: "ACLs";
                      },
                  ];
                  maxLength: 16777215;
                  referenceQual: "type=REST_Endpoint^operation=execute^EQ";
                  referenceTable: "sys_security_acl";
                  useReferenceQualifier: "simple";
              },
          >;
          http_method: Typed<
              "GET"
              | "POST"
              | "PUT"
              | "PATCH"
              | "DELETE",
              {
                  choices: {
                      DELETE: { label: "DELETE"; sequence: 50 };
                      GET: { label: "GET"; sequence: 10 };
                      PATCH: { label: "PATCH"; sequence: 40 };
                      POST: { label: "POST"; sequence: 20 };
                      PUT: { label: "PUT"; sequence: 30 };
                  };
                  default: "GET";
                  dropdown: "dropdown_without_none";
                  label: [
                      {
                          hint: "The HTTP method that maps to this resource";
                          label: "HTTP method";
                          plural: "HTTP methods";
                      },
                  ];
                  mandatory: true;
                  maxLength: 40;
              },
          >;
          name: Typed<
              string,
              {
                  attributes: { edge_encryption_enabled: true };
                  label: [
                      {
                          hint: "The name of this API resource. Appears in API documentation.";
                          label: "Name";
                          plural: "Names";
                      },
                  ];
                  mandatory: true;
                  maxLength: 40;
              },
          >;
          operation_script: Typed<
              string
              | ScriptModule<Function>,
              {
                  default: "(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {\r\n\r\n // implement resource here\r\n\r\n})(request, response);";
                  label: [
                      {
                          hint: "The script that implements the resource";
                          label: "Script";
                          plural: "Scripts";
                      },
                  ];
                  mandatory: true;
                  maxLength: 16777215;
              },
          >;
          operation_uri: Typed<
              string,
              {
                  attributes: { edge_encryption_enabled: true };
                  dynamicValueDefinitions: {
                      calculatedValue: "function normalizePath(path) {\n\t// replace repeating '/' chars with a single '/'\n\tpath = path.replace(/\\/+/g, '/');\n\tpath = path.trim();\n\t// remove the trailing '/' if present\n\tif (path.charAt(path.length-1) == '/')\n\t\tpath = path.substring(0, path.length-1);\n\t\n\treturn path;\n}\n\nfunction resolveOperationUri() {\n\tif (current.web_service_definition != '') {\n\t\tvar versionId = '';\n\t\tif (current.web_service_version != '')\n\t\t\tversionId = current.web_service_version.version_id + '/';\n\t\t\n\t\tvar endpointPath = '/api/' + current.web_service_definition.namespace + '/' + versionId\n\t\t+ current.web_service_definition.service_id\n\t\t+ '/' + current.relative_path;\n\t\t\n\t\treturn normalizePath(endpointPath);\n\t}\n\treturn '';\n}\n\ncurrent.operation_uri = resolveOperationUri();";
                      type: "calculated_value";
                  };
                  label: [
                      {
                          hint: "The resolved path of this resource including base API path, version, and relative path";
                          label: "Resource path";
                          plural: "Resource paths";
                      },
                  ];
                  maxLength: 255;
                  readOnly: true;
                  readOnlyOption: "instance_configured";
              },
          >;
          produces: Typed<
              string,
              {
                  attributes: { edge_encryption_enabled: true };
                  default: "javascript:current.produces = current.web_service_definition.produces";
                  label: [
                      {
                          hint: "Comma-delimited list of media types this resource can produce";
                          label: "Supported response formats";
                          plural: "Supported response formats";
                      },
                  ];
                  maxLength: 200;
              },
          >;
          produces_customized: Typed<
              boolean,
              {
                  default: false;
                  label: [
                      {
                          hint: "Check to customize the response media types supported by this resource";
                          label: "Override supported response formats";
                          plural: "Override supported response formats";
                      },
                  ];
                  maxLength: 30;
              },
          >;
          relative_path: Typed<
              string,
              {
                  attributes: { edge_encryption_enabled: true };
                  default: "/";
                  label: [
                      {
                          hint: "The path of this resource relative to the base API path. Can contain templatized path parameters such as /{id}.";
                          label: "Relative path";
                          plural: "Relative paths";
                      },
                  ];
                  maxLength: 255;
              },
          >;
          request_example: Typed<
              string,
              {
                  attributes: { edge_encryption_enabled: true };
                  label: [
                      {
                          hint: "An example request payload. Appears in API documentation.";
                          label: "Request body example";
                          plural: "Request body examples";
                      },
                  ];
                  maxLength: 16777215;
              },
          >;
          requires_acl_authorization: Typed<
              boolean,
              {
                  label: [
                      {
                          hint: "Enforce ACLs when this resource is accessed";
                          label: "Requires ACL authorization";
                          plural: "Requires ACL authorizations";
                      },
                  ];
                  maxLength: 30;
              },
          >;
          requires_authentication: Typed<
              boolean,
              {
                  default: true;
                  label: [
                      {
                          hint: "Whether requests must be authenticated to access this resource";
                          label: "Requires authentication";
                          plural: "Requires authentications";
                      },
                  ];
                  maxLength: 30;
              },
          >;
          requires_snc_internal_role: Typed<
              boolean,
              { default: true; label: "Requires SNC Internal"; maxLength: 40 },
          >;
          short_description: Typed<
              string,
              {
                  attributes: { edge_encryption_enabled: true };
                  label: [
                      {
                          hint: "The description of the resource. Appears in API documentation.";
                          label: "Short description";
                          plural: "Short descriptions";
                      },
                  ];
                  maxLength: 80;
              },
          >;
          support_trailing_slash: Typed<
              boolean,
              {
                  default: false;
                  label: [
                      {
                          hint: "Enabling allows this resource to be accessed with or without a trailing slash. Example: /resource and /resource/.";
                          label: "Support Trailing Slash";
                          plural: "Support Trailing Slashes";
                      },
                  ];
                  maxLength: 30;
              },
          >;
          web_service_definition: Typed<
              | string
              | Record<"sys_ws_definition">
              | ExplicitKey<"sys_ws_definition">
              | TableBrand<"sys_ws_definition">,
              {
                  attributes: { readonly_clickthrough: true };
                  cascadeRule: "delete";
                  label: [
                      {
                          hint: "The parent API this resource belongs to";
                          label: "API definition";
                          plural: "API definitions";
                      },
                  ];
                  mandatory: true;
                  maxLength: 32;
                  readOnly: true;
                  readOnlyOption: "instance_configured";
                  referenceTable: "sys_ws_definition";
              },
          >;
          web_service_version: Typed<
              | string
              | Record<"sys_ws_version">
              | ExplicitKey<"sys_ws_version">
              | TableBrand<"sys_ws_version">,
              {
                  attributes: { encode_utf8: false; ref_ac_order_by: "version" };
                  cascadeRule: "delete";
                  label: [
                      {
                          hint: "The version this resource belongs to";
                          label: "API version";
                          plural: "API versions";
                      },
                  ];
                  mandatory: false;
                  maxLength: 32;
                  referenceQual: "javascript:'web_service_definition=' + current.web_service_definition";
                  referenceTable: "sys_ws_version";
              },
          >;
      }
    • ReadonlytextIndex: true